From: Tomas Winkler Date: Tue, 18 Jan 2011 22:24:06 +0000 (+0200) Subject: staging: easycap: drop redunant backslashes from the code X-Git-Tag: MMI-PSA29.97-13-9~20521^2~839 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1dc6e41825aa270cfc0166beb54afb1c235dc803;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git staging: easycap: drop redunant backslashes from the code remove \ from the code where C syntex doesnt require it Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h index 1205f5f9f9e8..d8e4bb817188 100644 --- a/drivers/staging/easycap/easycap.h +++ b/drivers/staging/easycap/easycap.h @@ -384,9 +384,9 @@ int video_eof; int video_junk; struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY]; -struct data_buffer \ +struct data_buffer field_buffer[FIELD_BUFFER_MANY][(FIELD_BUFFER_SIZE/PAGE_SIZE)]; -struct data_buffer \ +struct data_buffer frame_buffer[FRAME_BUFFER_MANY][(FRAME_BUFFER_SIZE/PAGE_SIZE)]; struct list_head urb_video_head; @@ -518,9 +518,9 @@ struct data_buffer audio_buffer[]; void easycap_complete(struct urb *); int easycap_open(struct inode *, struct file *); int easycap_release(struct inode *, struct file *); -long easycap_ioctl_noinode(struct file *, unsigned int, \ +long easycap_ioctl_noinode(struct file *, unsigned int, unsigned long); -int easycap_ioctl(struct inode *, struct file *, unsigned int, \ +int easycap_ioctl(struct inode *, struct file *, unsigned int, unsigned long); /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ #if defined(EASYCAP_IS_VIDEODEV_CLIENT) @@ -532,7 +532,7 @@ int videodev_release(struct video_device *); unsigned int easycap_poll(struct file *, poll_table *); int easycap_mmap(struct file *, struct vm_area_struct *); -int easycap_usb_probe(struct usb_interface *, \ +int easycap_usb_probe(struct usb_interface *, const struct usb_device_id *); void easycap_usb_disconnect(struct usb_interface *); void easycap_delete(struct kref *); @@ -544,14 +544,14 @@ int easycap_dqbuf(struct easycap *, int); int submit_video_urbs(struct easycap *); int kill_video_urbs(struct easycap *); int field2frame(struct easycap *); -int redaub(struct easycap *, void *, void *, \ +int redaub(struct easycap *, void *, void *, int, int, __u8, __u8, bool); void easycap_testcard(struct easycap *, int); int fillin_formats(void); int reset(struct easycap *); int newinput(struct easycap *, int); int adjust_standard(struct easycap *, v4l2_std_id); -int adjust_format(struct easycap *, __u32, __u32, __u32, \ +int adjust_format(struct easycap *, __u32, __u32, __u32, int, bool); int adjust_brightness(struct easycap *, int); int adjust_contrast(struct easycap *, int); @@ -569,15 +569,14 @@ int easycap_alsa_probe(struct easycap *); void easycap_alsa_complete(struct urb *); int easycap_alsa_open(struct snd_pcm_substream *); int easycap_alsa_close(struct snd_pcm_substream *); -int easycap_alsa_hw_params(struct snd_pcm_substream *, \ +int easycap_alsa_hw_params(struct snd_pcm_substream *, struct snd_pcm_hw_params *); int easycap_alsa_vmalloc(struct snd_pcm_substream *, size_t); int easycap_alsa_hw_free(struct snd_pcm_substream *); int easycap_alsa_prepare(struct snd_pcm_substream *); int easycap_alsa_ack(struct snd_pcm_substream *); int easycap_alsa_trigger(struct snd_pcm_substream *, int); -snd_pcm_uframes_t \ - easycap_alsa_pointer(struct snd_pcm_substream *); +snd_pcm_uframes_t easycap_alsa_pointer(struct snd_pcm_substream *); struct page *easycap_alsa_page(struct snd_pcm_substream *, unsigned long); #else @@ -585,9 +584,9 @@ void easyoss_complete(struct urb *); ssize_t easyoss_read(struct file *, char __user *, size_t, loff_t *); int easyoss_open(struct inode *, struct file *); int easyoss_release(struct inode *, struct file *); -long easyoss_ioctl_noinode(struct file *, unsigned int, \ +long easyoss_ioctl_noinode(struct file *, unsigned int, unsigned long); -int easyoss_ioctl(struct inode *, struct file *, unsigned int, \ +int easyoss_ioctl(struct inode *, struct file *, unsigned int, unsigned long); unsigned int easyoss_poll(struct file *, poll_table *); void easyoss_delete(struct kref *); @@ -619,7 +618,7 @@ int ready_saa(struct usb_device *); int merit_saa(struct usb_device *); int check_vt(struct usb_device *); int select_input(struct usb_device *, int, int); -int set_resolution(struct usb_device *, \ +int set_resolution(struct usb_device *, __u16, __u16, __u16, __u16); int read_saa(struct usb_device *, __u16); diff --git a/drivers/staging/easycap/easycap_ioctl.c b/drivers/staging/easycap/easycap_ioctl.c index 20d30334233e..af6f04b06955 100644 --- a/drivers/staging/easycap/easycap_ioctl.c +++ b/drivers/staging/easycap/easycap_ioctl.c @@ -72,13 +72,13 @@ if (0xFFFF == peasycap_standard->mask) { } } if (0xFFFF == peasycap_standard->mask) { - SAM("ERROR: 0x%08X=std_id: standard not found\n", \ + SAM("ERROR: 0x%08X=std_id: standard not found\n", (unsigned int)std_id); return -EINVAL; } -SAM("selected standard: %s\n", \ +SAM("selected standard: %s\n", &(peasycap_standard->v4l2_standard.name[0])); -if (peasycap->standard_offset == \ +if (peasycap->standard_offset == (int)(peasycap_standard - &easycap_standard[0])) { SAM("requested standard already in effect\n"); return 0; @@ -86,17 +86,17 @@ if (peasycap->standard_offset == \ peasycap->standard_offset = (int)(peasycap_standard - &easycap_standard[0]); for (k = 0; k < INPUT_MANY; k++) { if (!peasycap->inputset[k].standard_offset_ok) { - peasycap->inputset[k].standard_offset = \ + peasycap->inputset[k].standard_offset = peasycap->standard_offset; } } if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) { - peasycap->inputset[peasycap->input].standard_offset = \ + peasycap->inputset[peasycap->input].standard_offset = peasycap->standard_offset; peasycap->inputset[peasycap->input].standard_offset_ok = 1; } else JOM(8, "%i=peasycap->input\n", peasycap->input); -peasycap->fps = peasycap_standard->v4l2_standard.frameperiod.denominator / \ +peasycap->fps = peasycap_standard->v4l2_standard.frameperiod.denominator / peasycap_standard->v4l2_standard.frameperiod.numerator; switch (peasycap->fps) { case 6: @@ -145,15 +145,15 @@ case NTSC_M_JP: { itwas = (unsigned int)ir; rc = write_saa(peasycap->pusb_device, reg, set); if (0 != rc) - SAM("ERROR: failed to set SAA register " \ + SAM("ERROR: failed to set SAA register " "0x%02X to 0x%02X for JP standard\n", reg, set); else { isnow = (unsigned int)read_saa(peasycap->pusb_device, reg); if (0 > ir) - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "to 0x%02X\n", reg, isnow); else - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "from 0x%02X to 0x%02X\n", reg, itwas, isnow); } @@ -165,15 +165,15 @@ case NTSC_M_JP: { itwas = (unsigned int)ir; rc = write_saa(peasycap->pusb_device, reg, set); if (0 != rc) - SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X " \ + SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X " "for JP standard\n", reg, set); else { isnow = (unsigned int)read_saa(peasycap->pusb_device, reg); if (0 > ir) - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "to 0x%02X\n", reg, isnow); else - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "from 0x%02X to 0x%02X\n", reg, itwas, isnow); } /*--------------------------------------------------------------------------*/ @@ -213,15 +213,15 @@ if (need) { itwas = (unsigned int)ir; rc = write_saa(peasycap->pusb_device, reg, set); if (0 != write_saa(peasycap->pusb_device, reg, set)) { - SAM("ERROR: failed to set SAA register " \ + SAM("ERROR: failed to set SAA register " "0x%02X to 0x%02X for table 42\n", reg, set); } else { isnow = (unsigned int)read_saa(peasycap->pusb_device, reg); if (0 > ir) - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "to 0x%02X\n", reg, isnow); else - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "from 0x%02X to 0x%02X\n", reg, itwas, isnow); } } @@ -233,7 +233,7 @@ if (need) { reg = 0x08; ir = read_saa(peasycap->pusb_device, reg); if (0 > ir) - SAM("ERROR: failed to read SAA register 0x%02X " \ + SAM("ERROR: failed to read SAA register 0x%02X " "so cannot reset\n", reg); else { itwas = (unsigned int)ir; @@ -243,15 +243,15 @@ else { set = itwas & ~0x40 ; rc = write_saa(peasycap->pusb_device, reg, set); if (0 != rc) - SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", \ + SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", reg, set); else { isnow = (unsigned int)read_saa(peasycap->pusb_device, reg); if (0 > ir) - JOM(8, "SAA register 0x%02X changed to 0x%02X\n", \ + JOM(8, "SAA register 0x%02X changed to 0x%02X\n", reg, isnow); else - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "from 0x%02X to 0x%02X\n", reg, itwas, isnow); } } @@ -263,7 +263,7 @@ else { reg = 0x40; ir = read_saa(peasycap->pusb_device, reg); if (0 > ir) - SAM("ERROR: failed to read SAA register 0x%02X " \ + SAM("ERROR: failed to read SAA register 0x%02X " "so cannot reset\n", reg); else { itwas = (unsigned int)ir; @@ -273,15 +273,15 @@ else { set = itwas & ~0x80 ; rc = write_saa(peasycap->pusb_device, reg, set); if (0 != rc) - SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", \ + SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", reg, set); else { isnow = (unsigned int)read_saa(peasycap->pusb_device, reg); if (0 > ir) - JOM(8, "SAA register 0x%02X changed to 0x%02X\n", \ + JOM(8, "SAA register 0x%02X changed to 0x%02X\n", reg, isnow); else - JOM(8, "SAA register 0x%02X changed " \ + JOM(8, "SAA register 0x%02X changed " "from 0x%02X to 0x%02X\n", reg, itwas, isnow); } } @@ -300,7 +300,7 @@ if (0 > ir) else set = 0x07 ; if (0 != write_saa(peasycap->pusb_device, reg, set)) - SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", \ + SAM("ERROR: failed to set SAA register 0x%02X to 0x%02X\n", reg, set); else { isnow = (unsigned int)read_saa(peasycap->pusb_device, reg); @@ -340,7 +340,7 @@ return 0; * ERRORS RETURN A NEGATIVE NUMBER. */ /*--------------------------------------------------------------------------*/ -int adjust_format(struct easycap *peasycap, \ +int adjust_format(struct easycap *peasycap, __u32 width, __u32 height, __u32 pixelformat, int field, bool try) { struct easycap_format *peasycap_format, *peasycap_best_format; @@ -369,7 +369,7 @@ uc = pixelformat; memcpy((void *)pc, (void *)(&uc), 4); bf[4] = 0; mask = 0xFF & easycap_standard[peasycap->standard_offset].mask; -SAM("sought: %ix%i,%s(0x%08X),%i=field,0x%02X=std mask\n", \ +SAM("sought: %ix%i,%s(0x%08X),%i=field,0x%02X=std mask\n", width, height, pc, pixelformat, field, mask); switch (field) { case V4L2_FIELD_ANY: { @@ -425,18 +425,18 @@ if (V4L2_FIELD_ANY == field) { peasycap_best_format = (struct easycap_format *)NULL; peasycap_format = &easycap_format[0]; while (0 != peasycap_format->v4l2_format.fmt.pix.width) { - JOM(16, ".> %i %i 0x%08X %ix%i\n", \ + JOM(16, ".> %i %i 0x%08X %ix%i\n", peasycap_format->mask & 0x01, peasycap_format->v4l2_format.fmt.pix.field, peasycap_format->v4l2_format.fmt.pix.pixelformat, peasycap_format->v4l2_format.fmt.pix.width, peasycap_format->v4l2_format.fmt.pix.height); - if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) && \ - (peasycap_format->v4l2_format.fmt.pix.field == field) && \ - (peasycap_format->v4l2_format.fmt.pix.pixelformat == \ - pixelformat) && \ - (peasycap_format->v4l2_format.fmt.pix.width == width) && \ + if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) && + (peasycap_format->v4l2_format.fmt.pix.field == field) && + (peasycap_format->v4l2_format.fmt.pix.pixelformat == + pixelformat) && + (peasycap_format->v4l2_format.fmt.pix.width == width) && (peasycap_format->v4l2_format.fmt.pix.height == height)) { peasycap_best_format = peasycap_format; break; @@ -444,16 +444,16 @@ while (0 != peasycap_format->v4l2_format.fmt.pix.width) { peasycap_format++; } if (0 == peasycap_format->v4l2_format.fmt.pix.width) { - SAM("cannot do: %ix%i with standard mask 0x%02X\n", \ + SAM("cannot do: %ix%i with standard mask 0x%02X\n", width, height, mask); peasycap_format = &easycap_format[0]; best = -1; while (0 != peasycap_format->v4l2_format.fmt.pix.width) { - if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) && \ - (peasycap_format->v4l2_format.fmt.pix\ - .field == field) && \ - (peasycap_format->v4l2_format.fmt.pix\ + if (((peasycap_format->mask & 0x1F) == (mask & 0x1F)) && + (peasycap_format->v4l2_format.fmt.pix + .field == field) && + (peasycap_format->v4l2_format.fmt.pix .pixelformat == pixelformat)) { - miss = abs(peasycap_format->\ + miss = abs(peasycap_format-> v4l2_format.fmt.pix.width - width); if ((best > miss) || (best < 0)) { best = miss; @@ -465,9 +465,9 @@ if (0 == peasycap_format->v4l2_format.fmt.pix.width) { peasycap_format++; } if (-1 == best) { - SAM("cannot do %ix... with standard mask 0x%02X\n", \ + SAM("cannot do %ix... with standard mask 0x%02X\n", width, mask); - SAM("cannot do ...x%i with standard mask 0x%02X\n", \ + SAM("cannot do ...x%i with standard mask 0x%02X\n", height, mask); SAM(" %ix%i unmatched\n", width, height); return peasycap->format_offset; @@ -488,8 +488,8 @@ if (false != try) { SAM("MISTAKE: true==try where is should be false\n"); return -EINVAL; } -SAM("actioning: %ix%i %s\n", \ - peasycap_format->v4l2_format.fmt.pix.width, \ +SAM("actioning: %ix%i %s\n", + peasycap_format->v4l2_format.fmt.pix.width, peasycap_format->v4l2_format.fmt.pix.height, &peasycap_format->name[0]); peasycap->height = peasycap_format->v4l2_format.fmt.pix.height; @@ -500,12 +500,12 @@ peasycap->format_offset = (int)(peasycap_format - &easycap_format[0]); for (k = 0; k < INPUT_MANY; k++) { if (!peasycap->inputset[k].format_offset_ok) { - peasycap->inputset[k].format_offset = \ + peasycap->inputset[k].format_offset = peasycap->format_offset; } } if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) { - peasycap->inputset[peasycap->input].format_offset = \ + peasycap->inputset[peasycap->input].format_offset = peasycap->format_offset; peasycap->inputset[peasycap->input].format_offset_ok = 1; } else @@ -534,9 +534,9 @@ if (true == peasycap->decimatepixel) multiplier = 2; else multiplier = 1; -peasycap->videofieldamount = multiplier * peasycap->width * \ +peasycap->videofieldamount = multiplier * peasycap->width * multiplier * peasycap->height; -peasycap->frame_buffer_used = peasycap->bytesperpixel * \ +peasycap->frame_buffer_used = peasycap->bytesperpixel * peasycap->width * peasycap->height; if (peasycap->video_isoc_streaming) { resubmit = true; @@ -549,29 +549,29 @@ if (peasycap->video_isoc_streaming) { */ /*---------------------------------------------------------------------------*/ if (0 == (0x01 & peasycap_format->mask)) { - if (((720 == peasycap_format->v4l2_format.fmt.pix.width) && \ - (576 == \ - peasycap_format->v4l2_format.fmt.pix.height)) || \ - ((360 == \ - peasycap_format->v4l2_format.fmt.pix.width) && \ - (288 == \ + if (((720 == peasycap_format->v4l2_format.fmt.pix.width) && + (576 == + peasycap_format->v4l2_format.fmt.pix.height)) || + ((360 == + peasycap_format->v4l2_format.fmt.pix.width) && + (288 == peasycap_format->v4l2_format.fmt.pix.height))) { if (0 != set_resolution(p, 0x0000, 0x0001, 0x05A0, 0x0121)) { SAM("ERROR: set_resolution() failed\n"); return -EINVAL; } - } else if ((704 == peasycap_format->v4l2_format.fmt.pix.width) && \ + } else if ((704 == peasycap_format->v4l2_format.fmt.pix.width) && (576 == peasycap_format->v4l2_format.fmt.pix.height)) { if (0 != set_resolution(p, 0x0004, 0x0001, 0x0584, 0x0121)) { SAM("ERROR: set_resolution() failed\n"); return -EINVAL; } - } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) && \ - (480 == \ - peasycap_format->v4l2_format.fmt.pix.height)) || \ - ((320 == \ - peasycap_format->v4l2_format.fmt.pix.width) && \ - (240 == \ + } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) && + (480 == + peasycap_format->v4l2_format.fmt.pix.height)) || + ((320 == + peasycap_format->v4l2_format.fmt.pix.width) && + (240 == peasycap_format->v4l2_format.fmt.pix.height))) { if (0 != set_resolution(p, 0x0014, 0x0020, 0x0514, 0x0110)) { SAM("ERROR: set_resolution() failed\n"); @@ -587,23 +587,23 @@ if (0 == (0x01 & peasycap_format->mask)) { */ /*---------------------------------------------------------------------------*/ } else { - if (((720 == peasycap_format->v4l2_format.fmt.pix.width) && \ - (480 == \ - peasycap_format->v4l2_format.fmt.pix.height)) || \ - ((360 == \ - peasycap_format->v4l2_format.fmt.pix.width) && \ - (240 == \ + if (((720 == peasycap_format->v4l2_format.fmt.pix.width) && + (480 == + peasycap_format->v4l2_format.fmt.pix.height)) || + ((360 == + peasycap_format->v4l2_format.fmt.pix.width) && + (240 == peasycap_format->v4l2_format.fmt.pix.height))) { if (0 != set_resolution(p, 0x0000, 0x0003, 0x05A0, 0x00F3)) { SAM("ERROR: set_resolution() failed\n"); return -EINVAL; } - } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) && \ - (480 == \ - peasycap_format->v4l2_format.fmt.pix.height)) || \ - ((320 == \ - peasycap_format->v4l2_format.fmt.pix.width) && \ - (240 == \ + } else if (((640 == peasycap_format->v4l2_format.fmt.pix.width) && + (480 == + peasycap_format->v4l2_format.fmt.pix.height)) || + ((320 == + peasycap_format->v4l2_format.fmt.pix.width) && + (240 == peasycap_format->v4l2_format.fmt.pix.height))) { if (0 != set_resolution(p, 0x0014, 0x0003, 0x0514, 0x00F3)) { SAM("ERROR: set_resolution() failed\n"); @@ -636,15 +636,15 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) { i1 = 0; while (0xFFFFFFFF != easycap_control[i1].id) { if (V4L2_CID_BRIGHTNESS == easycap_control[i1].id) { - if ((easycap_control[i1].minimum > value) || \ + if ((easycap_control[i1].minimum > value) || (easycap_control[i1].maximum < value)) value = easycap_control[i1].default_value; - if ((easycap_control[i1].minimum <= peasycap->brightness) && \ - (easycap_control[i1].maximum >= \ + if ((easycap_control[i1].minimum <= peasycap->brightness) && + (easycap_control[i1].maximum >= peasycap->brightness)) { if (peasycap->brightness == value) { - SAM("unchanged brightness at 0x%02X\n", \ + SAM("unchanged brightness at 0x%02X\n", value); return 0; } @@ -652,11 +652,11 @@ while (0xFFFFFFFF != easycap_control[i1].id) { peasycap->brightness = value; for (k = 0; k < INPUT_MANY; k++) { if (!peasycap->inputset[k].brightness_ok) - peasycap->inputset[k].brightness = \ + peasycap->inputset[k].brightness = peasycap->brightness; } if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) { - peasycap->inputset[peasycap->input].brightness = \ + peasycap->inputset[peasycap->input].brightness = peasycap->brightness; peasycap->inputset[peasycap->input].brightness_ok = 1; } else @@ -666,7 +666,7 @@ while (0xFFFFFFFF != easycap_control[i1].id) { SAM("adjusting brightness to 0x%02X\n", mood); return 0; } else { - SAM("WARNING: failed to adjust brightness " \ + SAM("WARNING: failed to adjust brightness " "to 0x%02X\n", mood); return -ENOENT; } @@ -694,14 +694,14 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) { i1 = 0; while (0xFFFFFFFF != easycap_control[i1].id) { if (V4L2_CID_CONTRAST == easycap_control[i1].id) { - if ((easycap_control[i1].minimum > value) || \ + if ((easycap_control[i1].minimum > value) || (easycap_control[i1].maximum < value)) value = easycap_control[i1].default_value; - if ((easycap_control[i1].minimum <= peasycap->contrast) && \ - (easycap_control[i1].maximum >= \ + if ((easycap_control[i1].minimum <= peasycap->contrast) && + (easycap_control[i1].maximum >= peasycap->contrast)) { if (peasycap->contrast == value) { SAM("unchanged contrast at 0x%02X\n", value); @@ -711,12 +711,12 @@ while (0xFFFFFFFF != easycap_control[i1].id) { peasycap->contrast = value; for (k = 0; k < INPUT_MANY; k++) { if (!peasycap->inputset[k].contrast_ok) { - peasycap->inputset[k].contrast = \ + peasycap->inputset[k].contrast = peasycap->contrast; } } if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) { - peasycap->inputset[peasycap->input].contrast = \ + peasycap->inputset[peasycap->input].contrast = peasycap->contrast; peasycap->inputset[peasycap->input].contrast_ok = 1; } else @@ -726,7 +726,7 @@ while (0xFFFFFFFF != easycap_control[i1].id) { SAM("adjusting contrast to 0x%02X\n", mood); return 0; } else { - SAM("WARNING: failed to adjust contrast to " \ + SAM("WARNING: failed to adjust contrast to " "0x%02X\n", mood); return -ENOENT; } @@ -754,16 +754,16 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) { i1 = 0; while (0xFFFFFFFF != easycap_control[i1].id) { if (V4L2_CID_SATURATION == easycap_control[i1].id) { - if ((easycap_control[i1].minimum > value) || \ + if ((easycap_control[i1].minimum > value) || (easycap_control[i1].maximum < value)) value = easycap_control[i1].default_value; - if ((easycap_control[i1].minimum <= peasycap->saturation) && \ - (easycap_control[i1].maximum >= \ + if ((easycap_control[i1].minimum <= peasycap->saturation) && + (easycap_control[i1].maximum >= peasycap->saturation)) { if (peasycap->saturation == value) { - SAM("unchanged saturation at 0x%02X\n", \ + SAM("unchanged saturation at 0x%02X\n", value); return 0; } @@ -771,12 +771,12 @@ while (0xFFFFFFFF != easycap_control[i1].id) { peasycap->saturation = value; for (k = 0; k < INPUT_MANY; k++) { if (!peasycap->inputset[k].saturation_ok) { - peasycap->inputset[k].saturation = \ + peasycap->inputset[k].saturation = peasycap->saturation; } } if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) { - peasycap->inputset[peasycap->input].saturation = \ + peasycap->inputset[peasycap->input].saturation = peasycap->saturation; peasycap->inputset[peasycap->input].saturation_ok = 1; } else @@ -786,7 +786,7 @@ while (0xFFFFFFFF != easycap_control[i1].id) { SAM("adjusting saturation to 0x%02X\n", mood); return 0; } else { - SAM("WARNING: failed to adjust saturation to " \ + SAM("WARNING: failed to adjust saturation to " "0x%02X\n", mood); return -ENOENT; } @@ -814,12 +814,12 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) { i1 = 0; while (0xFFFFFFFF != easycap_control[i1].id) { if (V4L2_CID_HUE == easycap_control[i1].id) { - if ((easycap_control[i1].minimum > value) || \ + if ((easycap_control[i1].minimum > value) || (easycap_control[i1].maximum < value)) value = easycap_control[i1].default_value; - if ((easycap_control[i1].minimum <= peasycap->hue) && \ - (easycap_control[i1].maximum >= \ + if ((easycap_control[i1].minimum <= peasycap->hue) && + (easycap_control[i1].maximum >= peasycap->hue)) { if (peasycap->hue == value) { SAM("unchanged hue at 0x%02X\n", value); @@ -832,7 +832,7 @@ while (0xFFFFFFFF != easycap_control[i1].id) { peasycap->inputset[k].hue = peasycap->hue; } if ((0 <= peasycap->input) && (INPUT_MANY > peasycap->input)) { - peasycap->inputset[peasycap->input].hue = \ + peasycap->inputset[peasycap->input].hue = peasycap->hue; peasycap->inputset[peasycap->input].hue_ok = 1; } else @@ -870,11 +870,11 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) { i1 = 0; while (0xFFFFFFFF != easycap_control[i1].id) { if (V4L2_CID_AUDIO_VOLUME == easycap_control[i1].id) { - if ((easycap_control[i1].minimum > value) || \ + if ((easycap_control[i1].minimum > value) || (easycap_control[i1].maximum < value)) value = easycap_control[i1].default_value; - if ((easycap_control[i1].minimum <= peasycap->volume) && \ - (easycap_control[i1].maximum >= \ + if ((easycap_control[i1].minimum <= peasycap->volume) && + (easycap_control[i1].maximum >= peasycap->volume)) { if (peasycap->volume == value) { SAM("unchanged volume at 0x%02X\n", value); @@ -882,14 +882,14 @@ while (0xFFFFFFFF != easycap_control[i1].id) { } } peasycap->volume = value; - mood = (16 > peasycap->volume) ? 16 : \ - ((31 < peasycap->volume) ? 31 : \ + mood = (16 > peasycap->volume) ? 16 : + ((31 < peasycap->volume) ? 31 : (__s8) peasycap->volume); if (!audio_gainset(peasycap->pusb_device, mood)) { SAM("adjusting volume to 0x%02X\n", mood); return 0; } else { - SAM("WARNING: failed to adjust volume to " \ + SAM("WARNING: failed to adjust volume to " "0x%2X\n", mood); return -ENOENT; } @@ -904,8 +904,8 @@ return -ENOENT; /*---------------------------------------------------------------------------*/ /* * AN ALTERNATIVE METHOD OF MUTING MIGHT SEEM TO BE: - * usb_set_interface(peasycap->pusb_device, \ - * peasycap->audio_interface, \ + * usb_set_interface(peasycap->pusb_device, + * peasycap->audio_interface, * peasycap->audio_altsetting_off); * HOWEVER, AFTER THIS COMMAND IS ISSUED ALL SUBSEQUENT URBS RECEIVE STATUS * -ESHUTDOWN. THE HANDLER ROUTINE easyxxx_complete() DECLINES TO RESUBMIT @@ -932,13 +932,13 @@ while (0xFFFFFFFF != easycap_control[i1].id) { case 1: { peasycap->audio_idle = 1; peasycap->timeval0.tv_sec = 0; - SAM("adjusting mute: %i=peasycap->audio_idle\n", \ + SAM("adjusting mute: %i=peasycap->audio_idle\n", peasycap->audio_idle); return 0; } default: { peasycap->audio_idle = 0; - SAM("adjusting mute: %i=peasycap->audio_idle\n", \ + SAM("adjusting mute: %i=peasycap->audio_idle\n", peasycap->audio_idle); return 0; } @@ -990,7 +990,7 @@ if (NULL == p) { kd = isdongle(peasycap); if (0 <= kd && DONGLE_MANY > kd) { if (mutex_lock_interruptible(&easycapdc60_dongle[kd].mutex_video)) { - SAY("ERROR: cannot lock " \ + SAY("ERROR: cannot lock " "easycapdc60_dongle[%i].mutex_video\n", kd); return -ERESTARTSYS; } @@ -1063,9 +1063,9 @@ case VIDIOC_QUERYCAP: { if (3 > i) { rc = (int) strict_strtol(p1, 10, &lng); if (0 != rc) { - SAM("ERROR: %i=strict_strtol(%s,.,,)\n", \ + SAM("ERROR: %i=strict_strtol(%s,.,,)\n", rc, p1); - mutex_unlock(&easycapdc60_dongle[kd].\ + mutex_unlock(&easycapdc60_dongle[kd]. mutex_video); return -EINVAL; } @@ -1075,27 +1075,27 @@ case VIDIOC_QUERYCAP: { } memset(&v4l2_capability, 0, sizeof(struct v4l2_capability)); - strlcpy(&v4l2_capability.driver[0], "easycap", \ + strlcpy(&v4l2_capability.driver[0], "easycap", sizeof(v4l2_capability.driver)); - v4l2_capability.capabilities = \ - V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | \ + v4l2_capability.capabilities = + V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE; v4l2_capability.version = KERNEL_VERSION(k[0], k[1], k[2]); JOM(8, "v4l2_capability.version=(%i,%i,%i)\n", k[0], k[1], k[2]); - strlcpy(&v4l2_capability.card[0], "EasyCAP DC60", \ + strlcpy(&v4l2_capability.card[0], "EasyCAP DC60", sizeof(v4l2_capability.card)); - if (usb_make_path(peasycap->pusb_device, &v4l2_capability.bus_info[0],\ + if (usb_make_path(peasycap->pusb_device, &v4l2_capability.bus_info[0], sizeof(v4l2_capability.bus_info)) < 0) { - strlcpy(&v4l2_capability.bus_info[0], "EasyCAP bus_info", \ + strlcpy(&v4l2_capability.bus_info[0], "EasyCAP bus_info", sizeof(v4l2_capability.bus_info)); - JOM(8, "%s=v4l2_capability.bus_info\n", \ + JOM(8, "%s=v4l2_capability.bus_info\n", &v4l2_capability.bus_info[0]); } - if (0 != copy_to_user((void __user *)arg, &v4l2_capability, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_capability, sizeof(struct v4l2_capability))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1109,7 +1109,7 @@ case VIDIOC_ENUMINPUT: { JOM(8, "VIDIOC_ENUMINPUT\n"); - if (0 != copy_from_user(&v4l2_input, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_input, (void __user *)arg, sizeof(struct v4l2_input))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1125,7 +1125,7 @@ case VIDIOC_ENUMINPUT: { v4l2_input.type = V4L2_INPUT_TYPE_CAMERA; v4l2_input.audioset = 0x01; v4l2_input.tuner = 0; - v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \ + v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | V4L2_STD_NTSC ; v4l2_input.status = 0; JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]); @@ -1137,7 +1137,7 @@ case VIDIOC_ENUMINPUT: { v4l2_input.type = V4L2_INPUT_TYPE_CAMERA; v4l2_input.audioset = 0x01; v4l2_input.tuner = 0; - v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \ + v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | V4L2_STD_NTSC ; v4l2_input.status = 0; JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]); @@ -1149,7 +1149,7 @@ case VIDIOC_ENUMINPUT: { v4l2_input.type = V4L2_INPUT_TYPE_CAMERA; v4l2_input.audioset = 0x01; v4l2_input.tuner = 0; - v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \ + v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | V4L2_STD_NTSC ; v4l2_input.status = 0; JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]); @@ -1161,7 +1161,7 @@ case VIDIOC_ENUMINPUT: { v4l2_input.type = V4L2_INPUT_TYPE_CAMERA; v4l2_input.audioset = 0x01; v4l2_input.tuner = 0; - v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \ + v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | V4L2_STD_NTSC ; v4l2_input.status = 0; JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]); @@ -1173,7 +1173,7 @@ case VIDIOC_ENUMINPUT: { v4l2_input.type = V4L2_INPUT_TYPE_CAMERA; v4l2_input.audioset = 0x01; v4l2_input.tuner = 0; - v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \ + v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | V4L2_STD_NTSC ; v4l2_input.status = 0; JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]); @@ -1185,7 +1185,7 @@ case VIDIOC_ENUMINPUT: { v4l2_input.type = V4L2_INPUT_TYPE_CAMERA; v4l2_input.audioset = 0x01; v4l2_input.tuner = 0; - v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | \ + v4l2_input.std = V4L2_STD_PAL | V4L2_STD_SECAM | V4L2_STD_NTSC ; v4l2_input.status = 0; JOM(8, "%i=index: %s\n", index, &v4l2_input.name[0]); @@ -1198,7 +1198,7 @@ case VIDIOC_ENUMINPUT: { } } - if (0 != copy_to_user((void __user *)arg, &v4l2_input, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_input, sizeof(struct v4l2_input))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1266,7 +1266,7 @@ case VIDIOC_ENUMAUDOUT: { JOM(8, "VIDIOC_ENUMAUDOUT\n"); - if (0 != copy_from_user(&v4l2_audioout, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_audioout, (void __user *)arg, sizeof(struct v4l2_audioout))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1280,7 +1280,7 @@ case VIDIOC_ENUMAUDOUT: { v4l2_audioout.index = 0; strcpy(&v4l2_audioout.name[0], "Soundtrack"); - if (0 != copy_to_user((void __user *)arg, &v4l2_audioout, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_audioout, sizeof(struct v4l2_audioout))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1294,7 +1294,7 @@ case VIDIOC_QUERYCTRL: { JOM(8, "VIDIOC_QUERYCTRL\n"); - if (0 != copy_from_user(&v4l2_queryctrl, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_queryctrl, (void __user *)arg, sizeof(struct v4l2_queryctrl))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1303,9 +1303,9 @@ case VIDIOC_QUERYCTRL: { i1 = 0; while (0xFFFFFFFF != easycap_control[i1].id) { if (easycap_control[i1].id == v4l2_queryctrl.id) { - JOM(8, "VIDIOC_QUERYCTRL %s=easycap_control[%i]" \ + JOM(8, "VIDIOC_QUERYCTRL %s=easycap_control[%i]" ".name\n", &easycap_control[i1].name[0], i1); - memcpy(&v4l2_queryctrl, &easycap_control[i1], \ + memcpy(&v4l2_queryctrl, &easycap_control[i1], sizeof(struct v4l2_queryctrl)); break; } @@ -1316,7 +1316,7 @@ case VIDIOC_QUERYCTRL: { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EINVAL; } - if (0 != copy_to_user((void __user *)arg, &v4l2_queryctrl, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_queryctrl, sizeof(struct v4l2_queryctrl))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1340,7 +1340,7 @@ case VIDIOC_G_CTRL: { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -ENOMEM; } - if (0 != copy_from_user(pv4l2_control, (void __user *)arg, \ + if (0 != copy_from_user(pv4l2_control, (void __user *)arg, sizeof(struct v4l2_control))) { kfree(pv4l2_control); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); @@ -1382,14 +1382,14 @@ case VIDIOC_G_CTRL: { break; } default: { - SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", \ + SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", pv4l2_control->id); kfree(pv4l2_control); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EINVAL; } } - if (0 != copy_to_user((void __user *)arg, pv4l2_control, \ + if (0 != copy_to_user((void __user *)arg, pv4l2_control, sizeof(struct v4l2_control))) { kfree(pv4l2_control); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); @@ -1410,7 +1410,7 @@ case VIDIOC_S_CTRL: JOM(8, "VIDIOC_S_CTRL\n"); - if (0 != copy_from_user(&v4l2_control, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_control, (void __user *)arg, sizeof(struct v4l2_control))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1461,7 +1461,7 @@ case VIDIOC_S_CTRL: break; } default: { - SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", \ + SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", v4l2_control.id); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EINVAL; @@ -1482,7 +1482,7 @@ case VIDIOC_ENUM_FMT: { JOM(8, "VIDIOC_ENUM_FMT\n"); - if (0 != copy_from_user(&v4l2_fmtdesc, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_fmtdesc, (void __user *)arg, sizeof(struct v4l2_fmtdesc))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1543,7 +1543,7 @@ case VIDIOC_ENUM_FMT: { return -EINVAL; } } - if (0 != copy_to_user((void __user *)arg, &v4l2_fmtdesc, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_fmtdesc, sizeof(struct v4l2_fmtdesc))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1562,7 +1562,7 @@ case VIDIOC_ENUM_FRAMESIZES: { JOM(8, "VIDIOC_ENUM_FRAMESIZES\n"); - if (0 != copy_from_user(&v4l2_frmsizeenum, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_frmsizeenum, (void __user *)arg, sizeof(struct v4l2_frmsizeenum))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1577,40 +1577,40 @@ case VIDIOC_ENUM_FRAMESIZES: { case 0: { v4l2_frmsizeenum.discrete.width = 640; v4l2_frmsizeenum.discrete.height = 480; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } case 1: { v4l2_frmsizeenum.discrete.width = 320; v4l2_frmsizeenum.discrete.height = 240; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } case 2: { v4l2_frmsizeenum.discrete.width = 720; v4l2_frmsizeenum.discrete.height = 480; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } case 3: { v4l2_frmsizeenum.discrete.width = 360; v4l2_frmsizeenum.discrete.height = 240; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } @@ -1625,50 +1625,50 @@ case VIDIOC_ENUM_FRAMESIZES: { case 0: { v4l2_frmsizeenum.discrete.width = 640; v4l2_frmsizeenum.discrete.height = 480; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } case 1: { v4l2_frmsizeenum.discrete.width = 320; v4l2_frmsizeenum.discrete.height = 240; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } case 2: { v4l2_frmsizeenum.discrete.width = 704; v4l2_frmsizeenum.discrete.height = 576; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } case 3: { v4l2_frmsizeenum.discrete.width = 720; v4l2_frmsizeenum.discrete.height = 576; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } case 4: { v4l2_frmsizeenum.discrete.width = 360; v4l2_frmsizeenum.discrete.height = 288; - JOM(8, "%i=index: %ix%i\n", index, \ - (int)(v4l2_frmsizeenum.\ - discrete.width), \ - (int)(v4l2_frmsizeenum.\ + JOM(8, "%i=index: %ix%i\n", index, + (int)(v4l2_frmsizeenum. + discrete.width), + (int)(v4l2_frmsizeenum. discrete.height)); break; } @@ -1679,7 +1679,7 @@ case VIDIOC_ENUM_FRAMESIZES: { } } } - if (0 != copy_to_user((void __user *)arg, &v4l2_frmsizeenum, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_frmsizeenum, sizeof(struct v4l2_frmsizeenum))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1708,7 +1708,7 @@ case VIDIOC_ENUM_FRAMEINTERVALS: { denominator = 25; } - if (0 != copy_from_user(&v4l2_frmivalenum, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_frmivalenum, (void __user *)arg, sizeof(struct v4l2_frmivalenum))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1722,16 +1722,16 @@ case VIDIOC_ENUM_FRAMEINTERVALS: { case 0: { v4l2_frmivalenum.discrete.numerator = 1; v4l2_frmivalenum.discrete.denominator = denominator; - JOM(8, "%i=index: %i/%i\n", index, \ - (int)(v4l2_frmivalenum.discrete.numerator), \ + JOM(8, "%i=index: %i/%i\n", index, + (int)(v4l2_frmivalenum.discrete.numerator), (int)(v4l2_frmivalenum.discrete.denominator)); break; } case 1: { v4l2_frmivalenum.discrete.numerator = 1; v4l2_frmivalenum.discrete.denominator = denominator/5; - JOM(8, "%i=index: %i/%i\n", index, \ - (int)(v4l2_frmivalenum.discrete.numerator), \ + JOM(8, "%i=index: %i/%i\n", index, + (int)(v4l2_frmivalenum.discrete.numerator), (int)(v4l2_frmivalenum.discrete.denominator)); break; } @@ -1741,7 +1741,7 @@ case VIDIOC_ENUM_FRAMEINTERVALS: { return -EINVAL; } } - if (0 != copy_to_user((void __user *)arg, &v4l2_frmivalenum, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_frmivalenum, sizeof(struct v4l2_frmivalenum))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1767,7 +1767,7 @@ case VIDIOC_G_FMT: { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -ENOMEM; } - if (0 != copy_from_user(pv4l2_format, (void __user *)arg, \ + if (0 != copy_from_user(pv4l2_format, (void __user *)arg, sizeof(struct v4l2_format))) { kfree(pv4l2_format); kfree(pv4l2_pix_format); @@ -1784,13 +1784,13 @@ case VIDIOC_G_FMT: { memset(pv4l2_pix_format, 0, sizeof(struct v4l2_pix_format)); pv4l2_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - memcpy(&pv4l2_format->fmt.pix, \ - &easycap_format[peasycap->format_offset]\ + memcpy(&pv4l2_format->fmt.pix, + &easycap_format[peasycap->format_offset] .v4l2_format.fmt.pix, sizeof(struct v4l2_pix_format)); - JOM(8, "user is told: %s\n", \ + JOM(8, "user is told: %s\n", &easycap_format[peasycap->format_offset].name[0]); - if (0 != copy_to_user((void __user *)arg, pv4l2_format, \ + if (0 != copy_to_user((void __user *)arg, pv4l2_format, sizeof(struct v4l2_format))) { kfree(pv4l2_format); kfree(pv4l2_pix_format); @@ -1817,17 +1817,17 @@ case VIDIOC_S_FMT: { try = false; } - if (0 != copy_from_user(&v4l2_format, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_format, (void __user *)arg, sizeof(struct v4l2_format))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; } - best_format = adjust_format(peasycap, \ - v4l2_format.fmt.pix.width, \ - v4l2_format.fmt.pix.height, \ - v4l2_format.fmt.pix.pixelformat, \ - v4l2_format.fmt.pix.field, \ + best_format = adjust_format(peasycap, + v4l2_format.fmt.pix.width, + v4l2_format.fmt.pix.height, + v4l2_format.fmt.pix.pixelformat, + v4l2_format.fmt.pix.field, try); if (0 > best_format) { if (-EBUSY == best_format) { @@ -1842,11 +1842,11 @@ case VIDIOC_S_FMT: { memset(&v4l2_pix_format, 0, sizeof(struct v4l2_pix_format)); v4l2_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - memcpy(&(v4l2_format.fmt.pix), &(easycap_format[best_format]\ + memcpy(&(v4l2_format.fmt.pix), &(easycap_format[best_format] .v4l2_format.fmt.pix), sizeof(v4l2_pix_format)); JOM(8, "user is told: %s\n", &easycap_format[best_format].name[0]); - if (0 != copy_to_user((void __user *)arg, &v4l2_format, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_format, sizeof(struct v4l2_format))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1859,7 +1859,7 @@ case VIDIOC_CROPCAP: { JOM(8, "VIDIOC_CROPCAP\n"); - if (0 != copy_from_user(&v4l2_cropcap, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_cropcap, (void __user *)arg, sizeof(struct v4l2_cropcap))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1883,7 +1883,7 @@ case VIDIOC_CROPCAP: { JOM(8, "user is told: %ix%i\n", peasycap->width, peasycap->height); - if (0 != copy_to_user((void __user *)arg, &v4l2_cropcap, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_cropcap, sizeof(struct v4l2_cropcap))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1899,7 +1899,7 @@ case VIDIOC_S_CROP: { } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ case VIDIOC_QUERYSTD: { - JOM(8, "VIDIOC_QUERYSTD: " \ + JOM(8, "VIDIOC_QUERYSTD: " "EasyCAP is incapable of detecting standard\n"); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EINVAL; @@ -1921,7 +1921,7 @@ case VIDIOC_ENUMSTD: { JOM(8, "VIDIOC_ENUMSTD\n"); - if (0 != copy_from_user(&v4l2_standard, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_standard, (void __user *)arg, sizeof(struct v4l2_standard))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1929,7 +1929,7 @@ case VIDIOC_ENUMSTD: { index = v4l2_standard.index; last3 = last2; last2 = last1; last1 = last0; last0 = index; - if ((index == last3) && (index == last2) && \ + if ((index == last3) && (index == last2) && (index == last1) && (index == last0)) { index++; last3 = last2; last2 = last1; last1 = last0; last0 = index; @@ -1948,14 +1948,14 @@ case VIDIOC_ENUMSTD: { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EINVAL; } - JOM(8, "%i=index: %s\n", index, \ + JOM(8, "%i=index: %s\n", index, &(peasycap_standard->v4l2_standard.name[0])); - memcpy(&v4l2_standard, &(peasycap_standard->v4l2_standard), \ + memcpy(&v4l2_standard, &(peasycap_standard->v4l2_standard), sizeof(struct v4l2_standard)); v4l2_standard.index = index; - if (0 != copy_to_user((void __user *)arg, &v4l2_standard, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_standard, sizeof(struct v4l2_standard))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1970,13 +1970,13 @@ case VIDIOC_G_STD: { JOM(8, "VIDIOC_G_STD\n"); if (0 > peasycap->standard_offset) { - JOM(8, "%i=peasycap->standard_offset\n", \ + JOM(8, "%i=peasycap->standard_offset\n", peasycap->standard_offset); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EBUSY; } - if (0 != copy_from_user(&std_id, (void __user *)arg, \ + if (0 != copy_from_user(&std_id, (void __user *)arg, sizeof(v4l2_std_id))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -1985,10 +1985,10 @@ case VIDIOC_G_STD: { peasycap_standard = &easycap_standard[peasycap->standard_offset]; std_id = peasycap_standard->v4l2_standard.id; - JOM(8, "user is told: %s\n", \ + JOM(8, "user is told: %s\n", &peasycap_standard->v4l2_standard.name[0]); - if (0 != copy_to_user((void __user *)arg, &std_id, \ + if (0 != copy_to_user((void __user *)arg, &std_id, sizeof(v4l2_std_id))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2002,14 +2002,14 @@ case VIDIOC_S_STD: { JOM(8, "VIDIOC_S_STD\n"); - if (0 != copy_from_user(&std_id, (void __user *)arg, \ + if (0 != copy_from_user(&std_id, (void __user *)arg, sizeof(v4l2_std_id))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; } - JOM(8, "User requests standard: 0x%08X%08X\n", \ - (int)((std_id & (((v4l2_std_id)0xFFFFFFFF) << 32)) >> 32), \ + JOM(8, "User requests standard: 0x%08X%08X\n", + (int)((std_id & (((v4l2_std_id)0xFFFFFFFF) << 32)) >> 32), (int)(std_id & ((v4l2_std_id)0xFFFFFFFF))); rc = adjust_standard(peasycap, std_id); @@ -2027,7 +2027,7 @@ case VIDIOC_REQBUFS: { JOM(8, "VIDIOC_REQBUFS\n"); - if (0 != copy_from_user(&v4l2_requestbuffers, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_requestbuffers, (void __user *)arg, sizeof(struct v4l2_requestbuffers))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2048,16 +2048,16 @@ case VIDIOC_REQBUFS: { if (nbuffers > FRAME_BUFFER_MANY) nbuffers = FRAME_BUFFER_MANY; if (v4l2_requestbuffers.count == nbuffers) { - JOM(8, " ... agree to %i buffers\n", \ + JOM(8, " ... agree to %i buffers\n", nbuffers); } else { - JOM(8, " ... insist on %i buffers\n", \ + JOM(8, " ... insist on %i buffers\n", nbuffers); v4l2_requestbuffers.count = nbuffers; } peasycap->frame_buffer_many = nbuffers; - if (0 != copy_to_user((void __user *)arg, &v4l2_requestbuffers, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_requestbuffers, sizeof(struct v4l2_requestbuffers))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2072,13 +2072,13 @@ case VIDIOC_QUERYBUF: { JOM(8, "VIDIOC_QUERYBUF\n"); if (peasycap->video_eof) { - JOM(8, "returning -EIO because %i=video_eof\n", \ + JOM(8, "returning -EIO because %i=video_eof\n", peasycap->video_eof); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EIO; } - if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, sizeof(struct v4l2_buffer))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2095,8 +2095,8 @@ case VIDIOC_QUERYBUF: { v4l2_buffer.index = index; v4l2_buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; v4l2_buffer.bytesused = peasycap->frame_buffer_used; - v4l2_buffer.flags = V4L2_BUF_FLAG_MAPPED | \ - peasycap->done[index] | \ + v4l2_buffer.flags = V4L2_BUF_FLAG_MAPPED | + peasycap->done[index] | peasycap->queued[index]; v4l2_buffer.field = V4L2_FIELD_NONE; v4l2_buffer.memory = V4L2_MEMORY_MMAP; @@ -2108,14 +2108,14 @@ case VIDIOC_QUERYBUF: { JOM(16, " %10i=bytesused\n", v4l2_buffer.bytesused); JOM(16, " 0x%08X=flags\n", v4l2_buffer.flags); JOM(16, " %10i=field\n", v4l2_buffer.field); - JOM(16, " %10li=timestamp.tv_usec\n", \ + JOM(16, " %10li=timestamp.tv_usec\n", (long)v4l2_buffer.timestamp.tv_usec); JOM(16, " %10i=sequence\n", v4l2_buffer.sequence); JOM(16, " 0x%08X=memory\n", v4l2_buffer.memory); JOM(16, " %10i=m.offset\n", v4l2_buffer.m.offset); JOM(16, " %10i=length\n", v4l2_buffer.length); - if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, sizeof(struct v4l2_buffer))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2128,7 +2128,7 @@ case VIDIOC_QBUF: { JOM(8, "VIDIOC_QBUF\n"); - if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, sizeof(struct v4l2_buffer))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2142,7 +2142,7 @@ case VIDIOC_QBUF: { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EINVAL; } - if (v4l2_buffer.index < 0 || \ + if (v4l2_buffer.index < 0 || (v4l2_buffer.index >= peasycap->frame_buffer_many)) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EINVAL; @@ -2152,13 +2152,13 @@ case VIDIOC_QBUF: { peasycap->done[v4l2_buffer.index] = 0; peasycap->queued[v4l2_buffer.index] = V4L2_BUF_FLAG_QUEUED; - if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, sizeof(struct v4l2_buffer))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; } - JOM(8, "..... user queueing frame buffer %i\n", \ + JOM(8, "..... user queueing frame buffer %i\n", (int)v4l2_buffer.index); peasycap->frame_lock = 0; @@ -2184,14 +2184,14 @@ case VIDIOC_DQBUF: JOM(8, "VIDIOC_DQBUF\n"); if ((peasycap->video_idle) || (peasycap->video_eof)) { - JOM(8, "returning -EIO because " \ - "%i=video_idle %i=video_eof\n", \ + JOM(8, "returning -EIO because " + "%i=video_idle %i=video_eof\n", peasycap->video_idle, peasycap->video_eof); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EIO; } - if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \ + if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, sizeof(struct v4l2_buffer))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2216,7 +2216,7 @@ case VIDIOC_DQBUF: else if (V4L2_FIELD_ANY == v4l2_buffer.field) JOM(8, "user wants V4L2_FIELD_ANY\n"); else - JOM(8, "user wants V4L2_FIELD_...UNKNOWN: %i\n", \ + JOM(8, "user wants V4L2_FIELD_...UNKNOWN: %i\n", v4l2_buffer.field); } @@ -2237,9 +2237,9 @@ case VIDIOC_DQBUF: do { rcdq = easycap_dqbuf(peasycap, 0); if (-EIO == rcdq) { - JOM(8, "returning -EIO because " \ + JOM(8, "returning -EIO because " "dqbuf() returned -EIO\n"); - mutex_unlock(&easycapdc60_dongle[kd].\ + mutex_unlock(&easycapdc60_dongle[kd]. mutex_video); return -EIO; } @@ -2251,7 +2251,7 @@ case VIDIOC_DQBUF: } } if (V4L2_BUF_FLAG_DONE != peasycap->done[peasycap->frame_read]) { - JOM(8, "V4L2_BUF_FLAG_DONE != 0x%08X\n", \ + JOM(8, "V4L2_BUF_FLAG_DONE != 0x%08X\n", peasycap->done[peasycap->frame_read]); } peasycap->polled = 0; @@ -2264,7 +2264,7 @@ case VIDIOC_DQBUF: for (i = 0; i < 180; i++) j += peasycap->merit[i]; if (90 < j) { - SAM("easycap driver shutting down " \ + SAM("easycap driver shutting down " "on condition blue\n"); peasycap->video_eof = 1; peasycap->audio_eof = 1; } @@ -2303,10 +2303,10 @@ case VIDIOC_DQBUF: timeval2.tv_sec = timeval1.tv_sec + sdr.quotient; } if (!(peasycap->isequence % 500)) { - fudge = ((long long int)(1000000)) * \ - ((long long int)(timeval.tv_sec - \ - timeval2.tv_sec)) + \ - (long long int)(timeval.tv_usec - \ + fudge = ((long long int)(1000000)) * + ((long long int)(timeval.tv_sec - + timeval2.tv_sec)) + + (long long int)(timeval.tv_usec - timeval2.tv_usec); sdr = signed_div(fudge, 1000); sll = sdr.quotient; @@ -2327,16 +2327,16 @@ case VIDIOC_DQBUF: JOM(16, " %10i=bytesused\n", v4l2_buffer.bytesused); JOM(16, " 0x%08X=flags\n", v4l2_buffer.flags); JOM(16, " %10i=field\n", v4l2_buffer.field); - JOM(16, " %10li=timestamp.tv_sec\n", \ + JOM(16, " %10li=timestamp.tv_sec\n", (long)v4l2_buffer.timestamp.tv_sec); - JOM(16, " %10li=timestamp.tv_usec\n", \ + JOM(16, " %10li=timestamp.tv_usec\n", (long)v4l2_buffer.timestamp.tv_usec); JOM(16, " %10i=sequence\n", v4l2_buffer.sequence); JOM(16, " 0x%08X=memory\n", v4l2_buffer.memory); JOM(16, " %10i=m.offset\n", v4l2_buffer.m.offset); JOM(16, " %10i=length\n", v4l2_buffer.length); - if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \ + if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, sizeof(struct v4l2_buffer))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -EFAULT; @@ -2344,17 +2344,17 @@ case VIDIOC_DQBUF: input = peasycap->frame_buffer[peasycap->frame_read][0].input; if (0x08 & input) { - JOM(8, "user is offered frame buffer %i, input %i\n", \ + JOM(8, "user is offered frame buffer %i, input %i\n", peasycap->frame_read, (0x07 & input)); } else { - JOM(8, "user is offered frame buffer %i\n", \ + JOM(8, "user is offered frame buffer %i\n", peasycap->frame_read); } peasycap->frame_lock = 1; JOM(8, "%i=peasycap->frame_fill\n", peasycap->frame_fill); if (peasycap->frame_read == peasycap->frame_fill) { if (peasycap->frame_lock) { - JOM(8, "WORRY: filling frame buffer " \ + JOM(8, "WORRY: filling frame buffer " "while offered to user\n"); } } @@ -2421,7 +2421,7 @@ case VIDIOC_G_PARM: { mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -ENOMEM; } - if (0 != copy_from_user(pv4l2_streamparm, (void __user *)arg, \ + if (0 != copy_from_user(pv4l2_streamparm, (void __user *)arg, sizeof(struct v4l2_streamparm))) { kfree(pv4l2_streamparm); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); @@ -2438,22 +2438,22 @@ case VIDIOC_G_PARM: { pv4l2_streamparm->parm.capture.timeperframe.numerator = 1; if (peasycap->fps) { - pv4l2_streamparm->parm.capture.timeperframe.\ + pv4l2_streamparm->parm.capture.timeperframe. denominator = peasycap->fps; } else { if (true == peasycap->ntsc) { - pv4l2_streamparm->parm.capture.timeperframe.\ + pv4l2_streamparm->parm.capture.timeperframe. denominator = 30; } else { - pv4l2_streamparm->parm.capture.timeperframe.\ + pv4l2_streamparm->parm.capture.timeperframe. denominator = 25; } } - pv4l2_streamparm->parm.capture.readbuffers = \ + pv4l2_streamparm->parm.capture.readbuffers = peasycap->frame_buffer_many; pv4l2_streamparm->parm.capture.extendedmode = 0; - if (0 != copy_to_user((void __user *)arg, pv4l2_streamparm, \ + if (0 != copy_to_user((void __user *)arg, pv4l2_streamparm, sizeof(struct v4l2_streamparm))) { kfree(pv4l2_streamparm); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); @@ -2520,7 +2520,7 @@ return 0; /*****************************************************************************/ #if !defined(EASYCAP_NEEDS_ALSA) /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ -#if ((defined(EASYCAP_IS_VIDEODEV_CLIENT)) || \ +#if ((defined(EASYCAP_IS_VIDEODEV_CLIENT)) || (defined(EASYCAP_NEEDS_UNLOCKED_IOCTL))) long easyoss_ioctl_noinode(struct file *file, unsigned int cmd, unsigned long arg) { @@ -2674,7 +2674,7 @@ case SNDCTL_DSP_SETFMT: { JOM(8, "........... %i=outgoing\n", outgoing); JOM(8, " cf. %i=AFMT_S16_LE\n", AFMT_S16_LE); JOM(8, " cf. %i=AFMT_U8\n", AFMT_U8); - if (0 != copy_to_user((void __user *)arg, &outgoing, \ + if (0 != copy_to_user((void __user *)arg, &outgoing, sizeof(int))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); return -EFAULT; @@ -2762,8 +2762,8 @@ case SNDCTL_DSP_SETTRIGGER: { return -EFAULT; } JOM(8, "........... %i=incoming\n", incoming); - JOM(8, "........... cf 0x%x=PCM_ENABLE_INPUT " \ - "0x%x=PCM_ENABLE_OUTPUT\n", \ + JOM(8, "........... cf 0x%x=PCM_ENABLE_INPUT " + "0x%x=PCM_ENABLE_OUTPUT\n", PCM_ENABLE_INPUT, PCM_ENABLE_OUTPUT); ; ; @@ -2796,7 +2796,7 @@ case SNDCTL_DSP_GETISPACE: { audio_buf_info.fragsize = 0; audio_buf_info.fragstotal = 0; - if (0 != copy_to_user((void __user *)arg, &audio_buf_info, \ + if (0 != copy_to_user((void __user *)arg, &audio_buf_info, sizeof(int))) { mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); return -EFAULT; diff --git a/drivers/staging/easycap/easycap_low.c b/drivers/staging/easycap/easycap_low.c index e9f3a36f50c4..ea0da6976d4c 100644 --- a/drivers/staging/easycap/easycap_low.c +++ b/drivers/staging/easycap/easycap_low.c @@ -259,28 +259,28 @@ GET(p, 0x0114, &get4); GET(p, 0x0115, &get5); GET(p, 0x0116, &get6); GET(p, 0x0117, &get7); -JOT(8, "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X\n", \ +JOT(8, "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X\n", get0, get1, get2, get3, get4, get5, get6, get7); -JOT(8, "....cf PAL_720x526: " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X\n", \ +JOT(8, "....cf PAL_720x526: " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X\n", 0x000, 0x000, 0x001, 0x000, 0x5A0, 0x005, 0x121, 0x001); -JOT(8, "....cf PAL_704x526: " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X\n", \ +JOT(8, "....cf PAL_704x526: " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X\n", 0x004, 0x000, 0x001, 0x000, 0x584, 0x005, 0x121, 0x001); -JOT(8, "....cf VGA_640x480: " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X, " \ - "0x%03X, 0x%03X\n", \ +JOT(8, "....cf VGA_640x480: " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X, " + "0x%03X, 0x%03X\n", 0x008, 0x000, 0x020, 0x000, 0x508, 0x005, 0x110, 0x001); return 0; } @@ -336,13 +336,13 @@ if (NULL == p) i0 = 0; if (true == ntsc) { while (0xFF != saa7113configNTSC[i0].reg) { - ir = write_saa(p, saa7113configNTSC[i0].reg, \ + ir = write_saa(p, saa7113configNTSC[i0].reg, saa7113configNTSC[i0].set); i0++; } } else { while (0xFF != saa7113configPAL[i0].reg) { - ir = write_saa(p, saa7113configPAL[i0].reg, \ + ir = write_saa(p, saa7113configPAL[i0].reg, saa7113configPAL[i0].set); i0++; } @@ -400,7 +400,7 @@ SET(p, 0x0500, 0x008B); GET(p, 0x0502, &igot); got502 = (0xFF & igot); GET(p, 0x0503, &igot); got503 = (0xFF & igot); -JOT(16, "write_vt(., 0x%04X, 0x%04X): was 0x%04X\n", \ +JOT(16, "write_vt(., 0x%04X, 0x%04X): was 0x%04X\n", reg0, set0, ((got503 << 8) | got502)); set502 = (0x00FF & set0); @@ -485,9 +485,9 @@ if (true == ntsc) { ir = read_saa(p, saa7113configNTSC[i0].reg); if (ir != saa7113configNTSC[i0].set) { - SAY("SAA register 0x%02X has 0x%02X, " \ - "expected 0x%02X\n", \ - saa7113configNTSC[i0].reg, \ + SAY("SAA register 0x%02X has 0x%02X, " + "expected 0x%02X\n", + saa7113configNTSC[i0].reg, ir, saa7113configNTSC[i0].set); rc--; } @@ -502,9 +502,9 @@ if (true == ntsc) { ir = read_saa(p, saa7113configPAL[i0].reg); if (ir != saa7113configPAL[i0].set) { - SAY("SAA register 0x%02X has 0x%02X, " \ - "expected 0x%02X\n", \ - saa7113configPAL[i0].reg, \ + SAY("SAA register 0x%02X has 0x%02X, " + "expected 0x%02X\n", + saa7113configPAL[i0].reg, ir, saa7113configPAL[i0].set); rc--; } @@ -603,23 +603,23 @@ if (true == ntsc) { } ir = read_stk(p, stk1160configNTSC[i0].reg); if (0x100 == stk1160configNTSC[i0].reg) { - if ((ir != (0xFF & stk1160configNTSC[i0].set)) && \ - (ir != (0x80 | (0xFF & \ - stk1160configNTSC[i0].set))) && \ - (0xFFFF != \ + if ((ir != (0xFF & stk1160configNTSC[i0].set)) && + (ir != (0x80 | (0xFF & + stk1160configNTSC[i0].set))) && + (0xFFFF != stk1160configNTSC[i0].set)) { - SAY("STK register 0x%03X has 0x%02X, " \ - "expected 0x%02X\n", \ - stk1160configNTSC[i0].reg, \ + SAY("STK register 0x%03X has 0x%02X, " + "expected 0x%02X\n", + stk1160configNTSC[i0].reg, ir, stk1160configNTSC[i0].set); } i0++; continue; } - if ((ir != (0xFF & stk1160configNTSC[i0].set)) && \ + if ((ir != (0xFF & stk1160configNTSC[i0].set)) && (0xFFFF != stk1160configNTSC[i0].set)) { - SAY("STK register 0x%03X has 0x%02X, " \ - "expected 0x%02X\n", \ - stk1160configNTSC[i0].reg, \ + SAY("STK register 0x%03X has 0x%02X, " + "expected 0x%02X\n", + stk1160configNTSC[i0].reg, ir, stk1160configNTSC[i0].set); } i0++; @@ -634,23 +634,23 @@ if (true == ntsc) { } ir = read_stk(p, stk1160configPAL[i0].reg); if (0x100 == stk1160configPAL[i0].reg) { - if ((ir != (0xFF & stk1160configPAL[i0].set)) && \ - (ir != (0x80 | (0xFF & \ - stk1160configPAL[i0].set))) && \ - (0xFFFF != \ + if ((ir != (0xFF & stk1160configPAL[i0].set)) && + (ir != (0x80 | (0xFF & + stk1160configPAL[i0].set))) && + (0xFFFF != stk1160configPAL[i0].set)) { - SAY("STK register 0x%03X has 0x%02X, " \ - "expected 0x%02X\n", \ - stk1160configPAL[i0].reg, \ + SAY("STK register 0x%03X has 0x%02X, " + "expected 0x%02X\n", + stk1160configPAL[i0].reg, ir, stk1160configPAL[i0].set); } i0++; continue; } - if ((ir != (0xFF & stk1160configPAL[i0].set)) && \ + if ((ir != (0xFF & stk1160configPAL[i0].set)) && (0xFFFF != stk1160configPAL[i0].set)) { - SAY("STK register 0x%03X has 0x%02X, " \ - "expected 0x%02X\n", \ - stk1160configPAL[i0].reg, \ + SAY("STK register 0x%03X has 0x%02X, " + "expected 0x%02X\n", + stk1160configPAL[i0].reg, ir, stk1160configPAL[i0].set); } i0++; @@ -717,7 +717,7 @@ switch (input) { case 0: case 1: { if (0 != write_saa(p, 0x02, 0x80)) { - SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \ + SAY("ERROR: failed to set SAA register 0x02 for input %i\n", input); } SET(p, 0x0000, 0x0098); @@ -726,7 +726,7 @@ case 1: { } case 2: { if (0 != write_saa(p, 0x02, 0x80)) { - SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \ + SAY("ERROR: failed to set SAA register 0x02 for input %i\n", input); } SET(p, 0x0000, 0x0090); @@ -735,7 +735,7 @@ case 2: { } case 3: { if (0 != write_saa(p, 0x02, 0x80)) { - SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \ + SAY("ERROR: failed to set SAA register 0x02 for input %i\n", input); } SET(p, 0x0000, 0x0088); @@ -744,7 +744,7 @@ case 3: { } case 4: { if (0 != write_saa(p, 0x02, 0x80)) { - SAY("ERROR: failed to set SAA register 0x02 for input %i\n", \ + SAY("ERROR: failed to set SAA register 0x02 for input %i\n", input); } SET(p, 0x0000, 0x0080); @@ -757,22 +757,22 @@ case 5: { switch (mode) { case 7: { if (0 != write_saa(p, 0x02, 0x87)) { - SAY("ERROR: failed to set SAA register 0x02 " \ + SAY("ERROR: failed to set SAA register 0x02 " "for input %i\n", input); } if (0 != write_saa(p, 0x05, 0xFF)) { - SAY("ERROR: failed to set SAA register 0x05 " \ + SAY("ERROR: failed to set SAA register 0x05 " "for input %i\n", input); } break; } case 9: { if (0 != write_saa(p, 0x02, 0x89)) { - SAY("ERROR: failed to set SAA register 0x02 " \ + SAY("ERROR: failed to set SAA register 0x02 " "for input %i\n", input); } if (0 != write_saa(p, 0x05, 0x00)) { - SAY("ERROR: failed to set SAA register 0x05 " \ + SAY("ERROR: failed to set SAA register 0x05 " "for input %i\n", input); } break; @@ -783,11 +783,11 @@ case 5: { } } if (0 != write_saa(p, 0x04, 0x00)) { - SAY("ERROR: failed to set SAA register 0x04 for input %i\n", \ + SAY("ERROR: failed to set SAA register 0x04 for input %i\n", input); } if (0 != write_saa(p, 0x09, 0x80)) { - SAY("ERROR: failed to set SAA register 0x09 for input %i\n", \ + SAY("ERROR: failed to set SAA register 0x09 for input %i\n", input); } SET(p, 0x0002, 0x0093); @@ -809,7 +809,7 @@ return 0; } /****************************************************************************/ int -set_resolution(struct usb_device *p, \ +set_resolution(struct usb_device *p, __u16 set0, __u16 set1, __u16 set2, __u16 set3) { __u16 u0x0111, u0x0113, u0x0115, u0x0117; @@ -915,25 +915,25 @@ int rc0, rc1; if (!pusb_device) return -ENODEV; rc1 = 0; igot = 0; -rc0 = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \ - (__u8)0x01, \ - (__u8)(USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE), \ - (__u16)value, \ - (__u16)index, \ - (void *)NULL, \ - (__u16)0, \ +rc0 = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), + (__u8)0x01, + (__u8)(USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE), + (__u16)value, + (__u16)index, + (void *)NULL, + (__u16)0, (int)500); #if defined(NOREADBACK) # #else -rc1 = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0), \ - (__u8)0x00, \ - (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE), \ - (__u16)0x00, \ - (__u16)index, \ - (void *)&igot, \ - (__u16)sizeof(__u16), \ +rc1 = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0), + (__u8)0x00, + (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE), + (__u16)0x00, + (__u16)index, + (void *)&igot, + (__u16)sizeof(__u16), (int)50000); igot = 0xFF & igot; switch (index) { @@ -951,15 +951,15 @@ case 0x205: case 0x350: case 0x351: { if (0 != (0xFF & igot)) { - JOT(8, "unexpected 0x%02X for STK register 0x%03X\n", \ + JOT(8, "unexpected 0x%02X for STK register 0x%03X\n", igot, index); } break; } default: { if ((0xFF & value) != (0xFF & igot)) { - JOT(8, "unexpected 0x%02X != 0x%02X " \ - "for STK register 0x%03X\n", \ + JOT(8, "unexpected 0x%02X != 0x%02X " + "for STK register 0x%03X\n", igot, value, index); } break; @@ -977,13 +977,13 @@ int ir; if (!pusb_device) return -ENODEV; -ir = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0), \ - (__u8)0x00, \ - (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE), \ - (__u16)0x00, \ - (__u16)index, \ - (void *)pvoid, \ - sizeof(__u8), \ +ir = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0), + (__u8)0x00, + (__u8)(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE), + (__u16)0x00, + (__u16)index, + (void *)pvoid, + sizeof(__u8), (int)50000); return 0xFF & ir; } @@ -993,13 +993,13 @@ wakeup_device(struct usb_device *pusb_device) { if (!pusb_device) return -ENODEV; -return usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \ - (__u8)USB_REQ_SET_FEATURE, \ - (__u8)(USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE), \ - USB_DEVICE_REMOTE_WAKEUP, \ - (__u16)0, \ - (void *) NULL, \ - (__u16)0, \ +return usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), + (__u8)USB_REQ_SET_FEATURE, + (__u8)(USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE), + USB_DEVICE_REMOTE_WAKEUP, + (__u16)0, + (void *) NULL, + (__u16)0, (int)50000); } /*****************************************************************************/ @@ -1018,7 +1018,7 @@ int rc, id1, id2; */ /*---------------------------------------------------------------------------*/ const __u8 request = 0x01; -const __u8 requesttype = \ +const __u8 requesttype = (__u8)(USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE); const __u16 value_unmute = 0x0200; const __u16 index = 0x0301; @@ -1031,24 +1031,24 @@ pusb_device = peasycap->pusb_device; if (NULL == pusb_device) return -ENODEV; -JOM(8, "%02X %02X %02X %02X %02X %02X %02X %02X\n", \ - requesttype, request, \ - (0x00FF & value_unmute), \ - (0xFF00 & value_unmute) >> 8, \ - (0x00FF & index), \ - (0xFF00 & index) >> 8, \ - (0x00FF & length), \ +JOM(8, "%02X %02X %02X %02X %02X %02X %02X %02X\n", + requesttype, request, + (0x00FF & value_unmute), + (0xFF00 & value_unmute) >> 8, + (0x00FF & index), + (0xFF00 & index) >> 8, + (0x00FF & length), (0xFF00 & length) >> 8); buffer[0] = 0x01; -rc = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \ - (__u8)request, \ - (__u8)requesttype, \ - (__u16)value_unmute, \ - (__u16)index, \ - (void *)&buffer[0], \ - (__u16)length, \ +rc = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), + (__u8)request, + (__u8)requesttype, + (__u16)value_unmute, + (__u16)index, + (void *)&buffer[0], + (__u16)length, (int)50000); JOT(8, "0x%02X=buffer\n", *((__u8 *) &buffer[0])); @@ -1209,7 +1209,7 @@ if (0 > igot) { mute = 0x8000 & ((unsigned int)igot); mute = 0; -JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x10,...0x18\n", \ +JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x10,...0x18\n", mute | u8 | (u8 << 8)); write_vt(pusb_device, 0x0010, (mute | u8 | (u8 << 8))); write_vt(pusb_device, 0x0012, (mute | u8 | (u8 << 8))); @@ -1230,7 +1230,7 @@ if (16 <= loud) else u8 = 0; -JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x1C\n", \ +JOT(8, "0x%04X=(mute|u8|(u8<<8)) for VT1612A register 0x1C\n", mute | u8 | (u8 << 8)); write_vt(pusb_device, 0x001C, (mute | u8 | (u8 << 8))); write_vt(pusb_device, 0x001A, 0x0404); diff --git a/drivers/staging/easycap/easycap_main.c b/drivers/staging/easycap/easycap_main.c index a0b954cfdd75..34a1ba663e0b 100644 --- a/drivers/staging/easycap/easycap_main.c +++ b/drivers/staging/easycap/easycap_main.c @@ -186,7 +186,7 @@ if (NULL == peasycap->pusb_device) { SAM("ERROR: peasycap->pusb_device is NULL\n"); return -EFAULT; } else { - JOM(16, "0x%08lX=peasycap->pusb_device\n", \ + JOM(16, "0x%08lX=peasycap->pusb_device\n", (long int)peasycap->pusb_device); } file->private_data = peasycap; @@ -272,7 +272,7 @@ else { rate = ready_saa(peasycap->pusb_device); if (0 > rate) { JOM(8, "not ready to capture after %i ms ...\n", PATIENCE); - JOM(8, "... saa register 0x1F has 0x%02X\n", \ + JOM(8, "... saa register 0x1F has 0x%02X\n", read_saa(peasycap->pusb_device, 0x1F)); ntsc = peasycap->ntsc; } else { @@ -323,17 +323,17 @@ if (true == other) { peasycap_standard = &easycap_standard[0]; while (0xFFFF != peasycap_standard->mask) { if (true == ntsc) { - if (NTSC_M == \ + if (NTSC_M == peasycap_standard->v4l2_standard.index) { - peasycap->inputset[input].standard_offset = \ - peasycap_standard - \ + peasycap->inputset[input].standard_offset = + peasycap_standard - &easycap_standard[0]; break; } } else { - if (PAL_BGHIN == \ + if (PAL_BGHIN == peasycap_standard->v4l2_standard.index) { - peasycap->inputset[input].standard_offset = \ + peasycap->inputset[input].standard_offset = peasycap_standard - &easycap_standard[0]; break; @@ -345,7 +345,7 @@ if (true == other) { SAM("ERROR: standard not found\n"); return -EINVAL; } -JOM(8, "%i=peasycap->inputset[%i].standard_offset\n", \ +JOM(8, "%i=peasycap->inputset[%i].standard_offset\n", peasycap->inputset[input].standard_offset, input); } peasycap->format_offset = -8192; @@ -372,12 +372,12 @@ if (0 > peasycap->input) { return -ENOENT; } if (0 > peasycap->standard_offset) { - SAM("MISTAKE: %i=peasycap->standard_offset\n", \ + SAM("MISTAKE: %i=peasycap->standard_offset\n", peasycap->standard_offset); return -ENOENT; } if (0 > peasycap->format_offset) { - SAM("MISTAKE: %i=peasycap->format_offset\n", \ + SAM("MISTAKE: %i=peasycap->format_offset\n", peasycap->format_offset); return -ENOENT; } @@ -458,7 +458,7 @@ if (NULL == peasycap->pusb_device) { return -ENODEV; } rc = usb_set_interface(peasycap->pusb_device, - peasycap->video_interface, \ + peasycap->video_interface, peasycap->video_altsetting_off); if (0 != rc) { SAM("ERROR: usb_set_interface() returned %i\n", rc); @@ -494,24 +494,24 @@ select_input(peasycap->pusb_device, peasycap->input, 9); if (input == peasycap->inputset[input].input) { off = peasycap->inputset[input].standard_offset; if (off != peasycap->standard_offset) { - rc = adjust_standard(peasycap, \ + rc = adjust_standard(peasycap, easycap_standard[off].v4l2_standard.id); if (0 != rc) { SAM("ERROR: adjust_standard() returned %i\n", rc); return -EFAULT; } - JOM(8, "%i=peasycap->standard_offset\n", \ + JOM(8, "%i=peasycap->standard_offset\n", peasycap->standard_offset); } else { - JOM(8, "%i=peasycap->standard_offset unchanged\n", \ + JOM(8, "%i=peasycap->standard_offset unchanged\n", peasycap->standard_offset); } off = peasycap->inputset[input].format_offset; if (off != peasycap->format_offset) { - rc = adjust_format(peasycap, \ - easycap_format[off].v4l2_format.fmt.pix.width, \ - easycap_format[off].v4l2_format.fmt.pix.height, \ - easycap_format[off].v4l2_format.fmt.pix.pixelformat, \ + rc = adjust_format(peasycap, + easycap_format[off].v4l2_format.fmt.pix.width, + easycap_format[off].v4l2_format.fmt.pix.height, + easycap_format[off].v4l2_format.fmt.pix.pixelformat, easycap_format[off].v4l2_format.fmt.pix.field, false); if (0 > rc) { SAM("ERROR: adjust_format() returned %i\n", rc); @@ -519,7 +519,7 @@ if (input == peasycap->inputset[input].input) { } JOM(8, "%i=peasycap->format_offset\n", peasycap->format_offset); } else { - JOM(8, "%i=peasycap->format_offset unchanged\n", \ + JOM(8, "%i=peasycap->format_offset unchanged\n", peasycap->format_offset); } mood = peasycap->inputset[input].brightness; @@ -568,7 +568,7 @@ if (NULL == peasycap->pusb_device) { return -ENODEV; } rc = usb_set_interface(peasycap->pusb_device, - peasycap->video_interface, \ + peasycap->video_interface, peasycap->video_altsetting_on); if (0 != rc) { SAM("ERROR: usb_set_interface() returned %i\n", rc); @@ -623,74 +623,74 @@ if (!peasycap->video_isoc_streaming) { isbuf = pdata_urb->isbuf; purb->interval = 1; purb->dev = peasycap->pusb_device; - purb->pipe = \ - usb_rcvisocpipe(peasycap->pusb_device,\ + purb->pipe = + usb_rcvisocpipe(peasycap->pusb_device, peasycap->video_endpointnumber); purb->transfer_flags = URB_ISO_ASAP; - purb->transfer_buffer = \ + purb->transfer_buffer = peasycap->video_isoc_buffer[isbuf].pgo; - purb->transfer_buffer_length = \ + purb->transfer_buffer_length = peasycap->video_isoc_buffer_size; purb->complete = easycap_complete; purb->context = peasycap; purb->start_frame = 0; - purb->number_of_packets = \ + purb->number_of_packets = peasycap->video_isoc_framesperdesc; - for (j = 0; j < peasycap->\ + for (j = 0; j < peasycap-> video_isoc_framesperdesc; j++) { - purb->iso_frame_desc[j].\ - offset = j * \ - peasycap->\ + purb->iso_frame_desc[j]. + offset = j * + peasycap-> video_isoc_maxframesize; - purb->iso_frame_desc[j].\ - length = peasycap->\ + purb->iso_frame_desc[j]. + length = peasycap-> video_isoc_maxframesize; } rc = usb_submit_urb(purb, GFP_KERNEL); if (0 != rc) { isbad++; - SAM("ERROR: usb_submit_urb() failed " \ + SAM("ERROR: usb_submit_urb() failed " "for urb with rc:\n"); switch (rc) { case -ENOMEM: { - SAM("ERROR: -ENOMEM=" \ + SAM("ERROR: -ENOMEM=" "usb_submit_urb()\n"); break; } case -ENODEV: { - SAM("ERROR: -ENODEV=" \ + SAM("ERROR: -ENODEV=" "usb_submit_urb()\n"); break; } case -ENXIO: { - SAM("ERROR: -ENXIO=" \ + SAM("ERROR: -ENXIO=" "usb_submit_urb()\n"); break; } case -EINVAL: { - SAM("ERROR: -EINVAL=" \ + SAM("ERROR: -EINVAL=" "usb_submit_urb()\n"); break; } case -EAGAIN: { - SAM("ERROR: -EAGAIN=" \ + SAM("ERROR: -EAGAIN=" "usb_submit_urb()\n"); break; } case -EFBIG: { - SAM("ERROR: -EFBIG=" \ + SAM("ERROR: -EFBIG=" "usb_submit_urb()\n"); break; } case -EPIPE: { - SAM("ERROR: -EPIPE=" \ + SAM("ERROR: -EPIPE=" "usb_submit_urb()\n"); break; } case -EMSGSIZE: { - SAM("ERROR: -EMSGSIZE=" \ + SAM("ERROR: -EMSGSIZE=" "usb_submit_urb()\n"); break; } @@ -699,8 +699,8 @@ if (!peasycap->video_isoc_streaming) { break; } default: { - SAM("ERROR: %i=" \ - "usb_submit_urb()\n",\ + SAM("ERROR: %i=" + "usb_submit_urb()\n", rc); break; } @@ -724,7 +724,7 @@ if (!peasycap->video_isoc_streaming) { if (isbad) { JOM(4, "attempting cleanup instead of submitting\n"); list_for_each(plist_head, (peasycap->purb_video_head)) { - pdata_urb = list_entry(plist_head, struct data_urb, \ + pdata_urb = list_entry(plist_head, struct data_urb, list_head); if (NULL != pdata_urb) { purb = pdata_urb->purb; @@ -760,7 +760,7 @@ if (peasycap->video_isoc_streaming) { JOM(4, "killing video urbs\n"); m = 0; list_for_each(plist_head, (peasycap->purb_video_head)) { - pdata_urb = list_entry(plist_head, struct data_urb, \ + pdata_urb = list_entry(plist_head, struct data_urb, list_head); if (NULL != pdata_urb) { if (NULL != pdata_urb->purb) { @@ -775,7 +775,7 @@ if (peasycap->video_isoc_streaming) { return -EFAULT; } } else { - JOM(8, "%i=video_isoc_streaming, no video urbs killed\n", \ + JOM(8, "%i=video_isoc_streaming, no video urbs killed\n", peasycap->video_isoc_streaming); } return 0; @@ -914,7 +914,7 @@ if ((struct list_head *)NULL != peasycap->purb_video_head) { pdata_urb = list_entry(plist_head, struct data_urb, list_head); if ((struct data_urb *)NULL != pdata_urb) { kfree(pdata_urb); pdata_urb = (struct data_urb *)NULL; - peasycap->allocation_video_struct -= \ + peasycap->allocation_video_struct -= sizeof(struct data_urb); m++; } @@ -928,11 +928,11 @@ JOM(4, "freeing video isoc buffers.\n"); m = 0; for (k = 0; k < VIDEO_ISOC_BUFFER_MANY; k++) { if ((void *)NULL != peasycap->video_isoc_buffer[k].pgo) { - free_pages((unsigned long)\ - (peasycap->video_isoc_buffer[k].pgo), \ + free_pages((unsigned long) + (peasycap->video_isoc_buffer[k].pgo), VIDEO_ISOC_ORDER); peasycap->video_isoc_buffer[k].pgo = (void *)NULL; - peasycap->allocation_video_page -= \ + peasycap->allocation_video_page -= ((unsigned int)(0x01 << VIDEO_ISOC_ORDER)); m++; } @@ -944,7 +944,7 @@ gone = 0; for (k = 0; k < FIELD_BUFFER_MANY; k++) { for (m = 0; m < FIELD_BUFFER_SIZE/PAGE_SIZE; m++) { if ((void *)NULL != peasycap->field_buffer[k][m].pgo) { - free_page((unsigned long)\ + free_page((unsigned long) (peasycap->field_buffer[k][m].pgo)); peasycap->field_buffer[k][m].pgo = (void *)NULL; peasycap->allocation_video_page -= 1; @@ -959,7 +959,7 @@ gone = 0; for (k = 0; k < FRAME_BUFFER_MANY; k++) { for (m = 0; m < FRAME_BUFFER_SIZE/PAGE_SIZE; m++) { if ((void *)NULL != peasycap->frame_buffer[k][m].pgo) { - free_page((unsigned long)\ + free_page((unsigned long) (peasycap->frame_buffer[k][m].pgo)); peasycap->frame_buffer[k][m].pgo = (void *)NULL; peasycap->allocation_video_page -= 1; @@ -997,7 +997,7 @@ if ((struct list_head *)NULL != peasycap->purb_audio_head) { pdata_urb = list_entry(plist_head, struct data_urb, list_head); if ((struct data_urb *)NULL != pdata_urb) { kfree(pdata_urb); pdata_urb = (struct data_urb *)NULL; - peasycap->allocation_audio_struct -= \ + peasycap->allocation_audio_struct -= sizeof(struct data_urb); m++; } @@ -1011,16 +1011,16 @@ JOM(4, "freeing audio isoc buffers.\n"); m = 0; for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) { if ((void *)NULL != peasycap->audio_isoc_buffer[k].pgo) { - free_pages((unsigned long)\ - (peasycap->audio_isoc_buffer[k].pgo), \ + free_pages((unsigned long) + (peasycap->audio_isoc_buffer[k].pgo), AUDIO_ISOC_ORDER); peasycap->audio_isoc_buffer[k].pgo = (void *)NULL; - peasycap->allocation_audio_page -= \ + peasycap->allocation_audio_page -= ((unsigned int)(0x01 << AUDIO_ISOC_ORDER)); m++; } } -JOM(4, "easyoss_delete(): isoc audio buffers freed: %i pages\n", \ +JOM(4, "easyoss_delete(): isoc audio buffers freed: %i pages\n", m * (0x01 << AUDIO_ISOC_ORDER)); /*---------------------------------------------------------------------------*/ #if !defined(EASYCAP_NEEDS_ALSA) @@ -1133,7 +1133,7 @@ if (0 <= kd && DONGLE_MANY > kd) { return -ERESTARTSYS; } if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { - SAY("ERROR: bad peasycap: 0x%08lX\n", \ + SAY("ERROR: bad peasycap: 0x%08lX\n", (unsigned long int) peasycap); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -ERESTARTSYS; @@ -1220,30 +1220,30 @@ if (0 <= input && INPUT_MANY > input) { */ /*---------------------------------------------------------------------------*/ miss = 0; -while ((peasycap->field_read == peasycap->field_fill) || \ - (0 != (0xFF00 & peasycap->field_buffer\ - [peasycap->field_read][0].kount)) || \ - (ifield != (0x00FF & peasycap->field_buffer\ +while ((peasycap->field_read == peasycap->field_fill) || + (0 != (0xFF00 & peasycap->field_buffer + [peasycap->field_read][0].kount)) || + (ifield != (0x00FF & peasycap->field_buffer [peasycap->field_read][0].kount))) { if (mode) return -EAGAIN; - JOM(8, "first wait on wq_video, " \ - "%i=field_read %i=field_fill\n", \ + JOM(8, "first wait on wq_video, " + "%i=field_read %i=field_fill\n", peasycap->field_read, peasycap->field_fill); - if (0 != (wait_event_interruptible(peasycap->wq_video, \ - (peasycap->video_idle || peasycap->video_eof || \ - ((peasycap->field_read != peasycap->field_fill) && \ - (0 == (0xFF00 & peasycap->field_buffer\ - [peasycap->field_read][0].kount)) && \ - (ifield == (0x00FF & peasycap->field_buffer\ + if (0 != (wait_event_interruptible(peasycap->wq_video, + (peasycap->video_idle || peasycap->video_eof || + ((peasycap->field_read != peasycap->field_fill) && + (0 == (0xFF00 & peasycap->field_buffer + [peasycap->field_read][0].kount)) && + (ifield == (0x00FF & peasycap->field_buffer [peasycap->field_read][0].kount))))))) { SAM("aborted by signal\n"); return -EIO; } if (peasycap->video_idle) { - JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n", \ + JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n", peasycap->video_idle); return -EAGAIN; } @@ -1289,30 +1289,30 @@ if (ifield) else ifield = 1; miss = 0; -while ((peasycap->field_read == peasycap->field_fill) || \ - (0 != (0xFF00 & peasycap->field_buffer\ - [peasycap->field_read][0].kount)) || \ - (ifield != (0x00FF & peasycap->field_buffer\ +while ((peasycap->field_read == peasycap->field_fill) || + (0 != (0xFF00 & peasycap->field_buffer + [peasycap->field_read][0].kount)) || + (ifield != (0x00FF & peasycap->field_buffer [peasycap->field_read][0].kount))) { if (mode) return -EAGAIN; - JOM(8, "second wait on wq_video, " \ - "%i=field_read %i=field_fill\n", \ + JOM(8, "second wait on wq_video, " + "%i=field_read %i=field_fill\n", peasycap->field_read, peasycap->field_fill); - if (0 != (wait_event_interruptible(peasycap->wq_video, \ - (peasycap->video_idle || peasycap->video_eof || \ - ((peasycap->field_read != peasycap->field_fill) && \ - (0 == (0xFF00 & peasycap->field_buffer\ - [peasycap->field_read][0].kount)) && \ - (ifield == (0x00FF & peasycap->field_buffer\ - [peasycap->field_read][0].\ + if (0 != (wait_event_interruptible(peasycap->wq_video, + (peasycap->video_idle || peasycap->video_eof || + ((peasycap->field_read != peasycap->field_fill) && + (0 == (0xFF00 & peasycap->field_buffer + [peasycap->field_read][0].kount)) && + (ifield == (0x00FF & peasycap->field_buffer + [peasycap->field_read][0]. kount))))))) { SAM("aborted by signal\n"); return -EIO; } if (peasycap->video_idle) { - JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n", \ + JOM(8, "%i=peasycap->video_idle ... returning -EAGAIN\n", peasycap->video_idle); return -EAGAIN; } @@ -1369,10 +1369,10 @@ if (peasycap->frame_buffer_many <= peasycap->frame_fill) peasycap->frame_fill = 0; if (0x01 & easycap_standard[peasycap->standard_offset].mask) { - peasycap->frame_buffer[peasycap->frame_read][0].kount = \ + peasycap->frame_buffer[peasycap->frame_read][0].kount = V4L2_FIELD_TOP; } else { - peasycap->frame_buffer[peasycap->frame_read][0].kount = \ + peasycap->frame_buffer[peasycap->frame_read][0].kount = V4L2_FIELD_BOTTOM; } @@ -1417,10 +1417,10 @@ if (NULL == peasycap) { badinput = false; input = 0x07 & peasycap->field_buffer[peasycap->field_read][0].input; -JOM(8, "===== parity %i, input 0x%02X, field buffer %i --> " \ - "frame buffer %i\n", \ - peasycap->field_buffer[peasycap->field_read][0].kount,\ - peasycap->field_buffer[peasycap->field_read][0].input,\ +JOM(8, "===== parity %i, input 0x%02X, field buffer %i --> " + "frame buffer %i\n", + peasycap->field_buffer[peasycap->field_read][0].kount, + peasycap->field_buffer[peasycap->field_read][0].input, peasycap->field_read, peasycap->frame_fill); JOM(8, "===== %i=bytesperpixel\n", peasycap->bytesperpixel); if (true == peasycap->offerfields) @@ -1432,7 +1432,7 @@ if (true == peasycap->offerfields) */ /*---------------------------------------------------------------------------*/ if (peasycap->field_read == peasycap->field_fill) { - SAM("ERROR: on entry, still filling field buffer %i\n", \ + SAM("ERROR: on entry, still filling field buffer %i\n", peasycap->field_read); return 0; } @@ -1450,8 +1450,8 @@ offerfields = peasycap->offerfields; bytesperpixel = peasycap->bytesperpixel; decimatepixel = peasycap->decimatepixel; -if ((2 != bytesperpixel) && \ - (3 != bytesperpixel) && \ +if ((2 != bytesperpixel) && + (3 != bytesperpixel) && (4 != bytesperpixel)) { SAM("MISTAKE: %i=bytesperpixel\n", bytesperpixel); return -EFAULT; @@ -1462,12 +1462,12 @@ else multiplier = 1; w2 = 2 * multiplier * (peasycap->width); -w3 = bytesperpixel * \ - multiplier * \ +w3 = bytesperpixel * + multiplier * (peasycap->width); -wz = multiplier * \ - (peasycap->height) * \ - multiplier * \ +wz = multiplier * + (peasycap->height) * + multiplier * (peasycap->width); kex = peasycap->field_read; mex = 0; @@ -1481,7 +1481,7 @@ else odd = false; if ((true == odd) && (false == decimatepixel)) { - JOM(8, " initial skipping %4i bytes p.%4i\n", \ + JOM(8, " initial skipping %4i bytes p.%4i\n", w3/multiplier, mad); pad += (w3 / multiplier); rad -= (w3 / multiplier); } @@ -1510,7 +1510,7 @@ while (cz < wz) { return -EFAULT; } - more = (bytesperpixel * \ + more = (bytesperpixel * much) / 2; /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ if (1 < bytesperpixel) { @@ -1521,9 +1521,9 @@ while (cz < wz) { ** BREAKAGE. BEWARE. **/ rad2 = rad + bytesperpixel - 1; - much = ((((2 * \ + much = ((((2 * rad2)/bytesperpixel)/2) * 2); - rump = ((bytesperpixel * \ + rump = ((bytesperpixel * much) / 2) - rad; more = rad; } @@ -1531,17 +1531,17 @@ while (cz < wz) { margin = 0; if (much == rex) { mask |= 0x04; - if ((mex + 1) < FIELD_BUFFER_SIZE/ \ + if ((mex + 1) < FIELD_BUFFER_SIZE/ PAGE_SIZE) { - margin = *((__u8 *)(peasycap->\ - field_buffer\ + margin = *((__u8 *)(peasycap-> + field_buffer [kex][mex + 1].pgo)); } else mask |= 0x08; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ } else { - SAM("MISTAKE: %i=bytesperpixel\n", \ + SAM("MISTAKE: %i=bytesperpixel\n", bytesperpixel); return -EFAULT; } @@ -1549,14 +1549,14 @@ while (cz < wz) { if (rump) caches++; if (true == badinput) { - JOM(8, "ERROR: 0x%02X=->field_buffer" \ - "[%i][%i].input, " \ - "0x%02X=(0x08|->input)\n", \ - peasycap->field_buffer\ - [kex][mex].input, kex, mex, \ + JOM(8, "ERROR: 0x%02X=->field_buffer" + "[%i][%i].input, " + "0x%02X=(0x08|->input)\n", + peasycap->field_buffer + [kex][mex].input, kex, mex, (0x08|peasycap->input)); } - rc = redaub(peasycap, pad, pex, much, more, \ + rc = redaub(peasycap, pad, pex, much, more, mask, margin, isuy); if (0 > rc) { SAM("ERROR: redaub() failed\n"); @@ -1574,7 +1574,7 @@ while (cz < wz) { mex++; pex = peasycap->field_buffer[kex][mex].pgo; rex = PAGE_SIZE; - if (peasycap->field_buffer[kex][mex].input != \ + if (peasycap->field_buffer[kex][mex].input != (0x08|peasycap->input)) badinput = true; } @@ -1601,7 +1601,7 @@ while (cz < wz) { do { if (!rad) { mad++; - pad = peasycap->frame_buffer\ + pad = peasycap->frame_buffer [kad][mad].pgo; rad = PAGE_SIZE; } @@ -1634,7 +1634,7 @@ while (cz < wz) { return -EFAULT; } - more = (bytesperpixel * \ + more = (bytesperpixel * much) / 4; /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ if (1 < bytesperpixel) { @@ -1645,9 +1645,9 @@ while (cz < wz) { ** BREAKAGE. BEWARE. **/ rad2 = rad + bytesperpixel - 1; - much = ((((2 * rad2)/bytesperpixel)/2)\ + much = ((((2 * rad2)/bytesperpixel)/2) * 4); - rump = ((bytesperpixel * \ + rump = ((bytesperpixel * much) / 4) - rad; more = rad; } @@ -1655,10 +1655,10 @@ while (cz < wz) { margin = 0; if (much == rex) { mask |= 0x04; - if ((mex + 1) < FIELD_BUFFER_SIZE/ \ + if ((mex + 1) < FIELD_BUFFER_SIZE/ PAGE_SIZE) { - margin = *((__u8 *)(peasycap->\ - field_buffer\ + margin = *((__u8 *)(peasycap-> + field_buffer [kex][mex + 1].pgo)); } else @@ -1666,7 +1666,7 @@ while (cz < wz) { } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ } else { - SAM("MISTAKE: %i=bytesperpixel\n", \ + SAM("MISTAKE: %i=bytesperpixel\n", bytesperpixel); return -EFAULT; } @@ -1675,14 +1675,14 @@ while (cz < wz) { caches++; if (true == badinput) { - JOM(8, "ERROR: 0x%02X=->field_buffer" \ - "[%i][%i].input, " \ - "0x%02X=(0x08|->input)\n", \ - peasycap->field_buffer\ - [kex][mex].input, kex, mex, \ + JOM(8, "ERROR: 0x%02X=->field_buffer" + "[%i][%i].input, " + "0x%02X=(0x08|->input)\n", + peasycap->field_buffer + [kex][mex].input, kex, mex, (0x08|peasycap->input)); } - rc = redaub(peasycap, pad, pex, much, more, \ + rc = redaub(peasycap, pad, pex, much, more, mask, margin, isuy); if (0 > rc) { SAM("ERROR: redaub() failed\n"); @@ -1694,7 +1694,7 @@ while (cz < wz) { mex++; pex = peasycap->field_buffer[kex][mex].pgo; rex = PAGE_SIZE; - if (peasycap->field_buffer[kex][mex].input != \ + if (peasycap->field_buffer[kex][mex].input != (0x08|peasycap->input)) badinput = true; } @@ -1723,13 +1723,13 @@ while (cz < wz) { mex++; pex = peasycap->field_buffer[kex][mex].pgo; rex = PAGE_SIZE; - if (peasycap->field_buffer[kex][mex].input != \ + if (peasycap->field_buffer[kex][mex].input != (0x08|peasycap->input)) { - JOM(8, "ERROR: 0x%02X=->field_buffer"\ - "[%i][%i].input, " \ - "0x%02X=(0x08|->input)\n", \ - peasycap->field_buffer\ - [kex][mex].input, kex, mex, \ + JOM(8, "ERROR: 0x%02X=->field_buffer" + "[%i][%i].input, " + "0x%02X=(0x08|->input)\n", + peasycap->field_buffer + [kex][mex].input, kex, mex, (0x08|peasycap->input)); badinput = true; } @@ -1755,21 +1755,21 @@ if (cz != c2) c3 = (mad + 1)*PAGE_SIZE - rad; if (false == decimatepixel) { - if (bytesperpixel * \ - cz != c3) \ - SAM("ERROR: discrepancy %i in bytes written\n", \ - c3 - (bytesperpixel * \ + if (bytesperpixel * + cz != c3) + SAM("ERROR: discrepancy %i in bytes written\n", + c3 - (bytesperpixel * cz)); } else { if (false == odd) { - if (bytesperpixel * \ + if (bytesperpixel * cz != (4 * c3)) - SAM("ERROR: discrepancy %i in bytes written\n", \ - (2*c3)-(bytesperpixel * \ + SAM("ERROR: discrepancy %i in bytes written\n", + (2*c3)-(bytesperpixel * cz)); } else { if (0 != c3) - SAM("ERROR: discrepancy %i " \ + SAM("ERROR: discrepancy %i " "in bytes written\n", c3); } } @@ -1783,7 +1783,7 @@ if (true == odd) JOM(8, "+++++ field2frame(): frame buffer %i is full\n", kad); if (peasycap->field_read == peasycap->field_fill) - SAM("WARNING: on exit, filling field buffer %i\n", \ + SAM("WARNING: on exit, filling field buffer %i\n", peasycap->field_read); /*---------------------------------------------------------------------------*/ /* @@ -1792,9 +1792,9 @@ if (peasycap->field_read == peasycap->field_fill) /*---------------------------------------------------------------------------*/ do_gettimeofday(&timeval); if (peasycap->timeval6.tv_sec) { - below = ((long long int)(1000000)) * \ - ((long long int)(timeval.tv_sec - \ - peasycap->timeval6.tv_sec)) + \ + below = ((long long int)(1000000)) * + ((long long int)(timeval.tv_sec - + peasycap->timeval6.tv_sec)) + (long long int)(timeval.tv_usec - peasycap->timeval6.tv_usec); above = (long long int)1000000; @@ -1802,7 +1802,7 @@ if (peasycap->timeval6.tv_sec) { above = sdr.quotient; remainder = (__u32)sdr.remainder; - JOM(8, "video streaming at %3lli.%03i fields per second\n", above, \ + JOM(8, "video streaming at %3lli.%03i fields per second\n", above, (remainder/1000)); } peasycap->timeval6 = timeval; @@ -1857,7 +1857,7 @@ return sdr; */ /*---------------------------------------------------------------------------*/ int -redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, \ +redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, __u8 mask, __u8 margin, bool isuy) { static __s32 ay[256], bu[256], rv[256], gu[256], gv[256]; @@ -2037,13 +2037,13 @@ case 3: } s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2062,7 +2062,7 @@ case 3: break; } default: { - SAM("MISTAKE: %i=rump\n", \ + SAM("MISTAKE: %i=rump\n", bytesperpixel - rump); return -EFAULT; } @@ -2110,13 +2110,13 @@ case 3: } s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2135,7 +2135,7 @@ case 3: break; } default: { - SAM("MISTAKE: %i=rump\n", \ + SAM("MISTAKE: %i=rump\n", bytesperpixel - rump); return -EFAULT; } @@ -2185,14 +2185,14 @@ case 3: if (true == isuy) { s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); - s32 = ay[(int)y] - gu[(int)u] - \ + s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2211,8 +2211,8 @@ case 3: break; } default: { - SAM("MISTAKE: " \ - "%i=rump\n", \ + SAM("MISTAKE: " + "%i=rump\n", bytesperpixel - rump); return -EFAULT; } @@ -2261,14 +2261,14 @@ case 3: if (true == isuy) { s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); - s32 = ay[(int)y] - gu[(int)u] - \ + s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2287,8 +2287,8 @@ case 3: break; } default: { - SAM("MISTAKE: " \ - "%i=rump\n", \ + SAM("MISTAKE: " + "%i=rump\n", bytesperpixel - rump); return -EFAULT; } @@ -2342,13 +2342,13 @@ case 4: } s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2376,7 +2376,7 @@ case 4: break; } default: { - SAM("MISTAKE: %i=rump\n", \ + SAM("MISTAKE: %i=rump\n", bytesperpixel - rump); return -EFAULT; } @@ -2424,13 +2424,13 @@ case 4: } s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2458,7 +2458,7 @@ case 4: break; } default: { - SAM("MISTAKE: %i=rump\n", \ + SAM("MISTAKE: %i=rump\n", bytesperpixel - rump); return -EFAULT; } @@ -2510,14 +2510,14 @@ case 4: if (true == isuy) { s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); - s32 = ay[(int)y] - gu[(int)u] - \ + s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2545,9 +2545,9 @@ case 4: break; } default: { - SAM("MISTAKE: " \ - "%i=rump\n", \ - bytesperpixel - \ + SAM("MISTAKE: " + "%i=rump\n", + bytesperpixel - rump); return -EFAULT; } @@ -2595,14 +2595,14 @@ case 4: if (true == isuy) { s32 = ay[(int)y] + rv[(int)v]; - r = (255 < s32) ? 255 : ((0 > s32) ? \ + r = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); - s32 = ay[(int)y] - gu[(int)u] - \ + s32 = ay[(int)y] - gu[(int)u] - gv[(int)v]; - g = (255 < s32) ? 255 : ((0 > s32) ? \ + g = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); s32 = ay[(int)y] + bu[(int)u]; - b = (255 < s32) ? 255 : ((0 > s32) ? \ + b = (255 < s32) ? 255 : ((0 > s32) ? 0 : (__u8)s32); if ((true == last) && rump) { @@ -2630,8 +2630,8 @@ case 4: break; } default: { - SAM("MISTAKE: " \ - "%i=rump\n", \ + SAM("MISTAKE: " + "%i=rump\n", bytesperpixel - rump); return -EFAULT; } @@ -2840,16 +2840,16 @@ for (i = 0; i < VIDEO_ISOC_BUFFER_MANY; i++) break; JOM(16, "%2i=urb\n", i); last = peasycap->video_isoc_sequence; -if ((((VIDEO_ISOC_BUFFER_MANY - 1) == last) && \ - (0 != i)) || \ - (((VIDEO_ISOC_BUFFER_MANY - 1) != last) && \ +if ((((VIDEO_ISOC_BUFFER_MANY - 1) == last) && + (0 != i)) || + (((VIDEO_ISOC_BUFFER_MANY - 1) != last) && ((last + 1) != i))) { JOM(16, "ERROR: out-of-order urbs %i,%i ... continuing\n", last, i); } peasycap->video_isoc_sequence = i; if (peasycap->video_idle) { - JOM(16, "%i=video_idle %i=video_isoc_streaming\n", \ + JOM(16, "%i=video_idle %i=video_isoc_streaming\n", peasycap->video_idle, peasycap->video_isoc_streaming); if (peasycap->video_isoc_streaming) { rc = usb_submit_urb(purb, GFP_ATOMIC); @@ -2896,10 +2896,10 @@ if (peasycap->video_idle) { break; } } - if (-ENODEV != rc) \ - SAM("ERROR: while %i=video_idle, " \ - "usb_submit_urb() " \ - "failed with rc:\n", \ + if (-ENODEV != rc) + SAM("ERROR: while %i=video_idle, " + "usb_submit_urb() " + "failed with rc:\n", peasycap->video_idle); } } @@ -2988,7 +2988,7 @@ if (purb->status) { } else { for (i = 0; i < purb->number_of_packets; i++) { if (0 != purb->iso_frame_desc[i].status) { - (peasycap->field_buffer\ + (peasycap->field_buffer [peasycap->field_fill][0].kount) |= 0x8000 ; switch (purb->iso_frame_desc[i].status) { case 0: { @@ -3055,24 +3055,24 @@ if (purb->status) { frameactual = purb->iso_frame_desc[i].actual_length; frameoffset = purb->iso_frame_desc[i].offset; - JOM(16, "frame[%2i]:" \ - "%4i=status " \ - "%4i=actual " \ - "%4i=length " \ - "%5i=offset\n", \ + JOM(16, "frame[%2i]:" + "%4i=status " + "%4i=actual " + "%4i=length " + "%5i=offset\n", i, framestatus, frameactual, framelength, frameoffset); if (!purb->iso_frame_desc[i].status) { more = purb->iso_frame_desc[i].actual_length; - pfield_buffer = &peasycap->field_buffer\ + pfield_buffer = &peasycap->field_buffer [peasycap->field_fill][peasycap->field_page]; - videofieldamount = (peasycap->field_page * \ - PAGE_SIZE) + \ + videofieldamount = (peasycap->field_page * + PAGE_SIZE) + (int)(pfield_buffer->pto - pfield_buffer->pgo); if (4 == more) peasycap->video_mt++; if (4 < more) { if (peasycap->video_mt) { - JOM(8, "%4i empty video urb frames\n", \ + JOM(8, "%4i empty video urb frames\n", peasycap->video_mt); peasycap->video_mt = 0; } @@ -3080,14 +3080,14 @@ if (purb->status) { SAM("ERROR: bad peasycap->field_fill\n"); return; } - if (FIELD_BUFFER_SIZE/PAGE_SIZE <= \ + if (FIELD_BUFFER_SIZE/PAGE_SIZE <= peasycap->field_page) { SAM("ERROR: bad peasycap->field_page\n"); return; } - pfield_buffer = &peasycap->field_buffer\ + pfield_buffer = &peasycap->field_buffer [peasycap->field_fill][peasycap->field_page]; - pu = (__u8 *)(purb->transfer_buffer + \ + pu = (__u8 *)(purb->transfer_buffer + purb->iso_frame_desc[i].offset); if (0x80 & *pu) leap = 8; @@ -3111,124 +3111,124 @@ if (purb->status) { */ /*---------------------------------------------------------------------------*/ if ((8 == more) || override) { - if (videofieldamount > \ + if (videofieldamount > peasycap->videofieldamount) { - if (2 == videofieldamount - \ - peasycap->\ + if (2 == videofieldamount - + peasycap-> videofieldamount) { - (peasycap->field_buffer\ - [peasycap->field_fill]\ + (peasycap->field_buffer + [peasycap->field_fill] [0].kount) |= 0x0100; - peasycap->video_junk += (1 + \ + peasycap->video_junk += (1 + VIDEO_JUNK_TOLERATE); } else - (peasycap->field_buffer\ - [peasycap->field_fill]\ + (peasycap->field_buffer + [peasycap->field_fill] [0].kount) |= 0x4000; - } else if (videofieldamount < \ - peasycap->\ + } else if (videofieldamount < + peasycap-> videofieldamount) { - (peasycap->field_buffer\ - [peasycap->field_fill]\ + (peasycap->field_buffer + [peasycap->field_fill] [0].kount) |= 0x2000; } - bad = 0xFF00 & peasycap->field_buffer\ - [peasycap->field_fill]\ + bad = 0xFF00 & peasycap->field_buffer + [peasycap->field_fill] [0].kount; if (!bad) { (peasycap->video_junk)--; - if (-VIDEO_JUNK_TOLERATE > \ - peasycap->video_junk) \ - peasycap->video_junk =\ + if (-VIDEO_JUNK_TOLERATE > + peasycap->video_junk) + peasycap->video_junk = -VIDEO_JUNK_TOLERATE; - peasycap->field_read = \ - (peasycap->\ + peasycap->field_read = + (peasycap-> field_fill)++; - if (FIELD_BUFFER_MANY <= \ - peasycap->\ + if (FIELD_BUFFER_MANY <= + peasycap-> field_fill) - peasycap->\ + peasycap-> field_fill = 0; peasycap->field_page = 0; - pfield_buffer = &peasycap->\ - field_buffer\ - [peasycap->\ - field_fill]\ - [peasycap->\ + pfield_buffer = &peasycap-> + field_buffer + [peasycap-> + field_fill] + [peasycap-> field_page]; - pfield_buffer->pto = \ + pfield_buffer->pto = pfield_buffer->pgo; - JOM(8, "bumped to: %i="\ - "peasycap->" \ - "field_fill %i="\ - "parity\n", \ - peasycap->field_fill, \ - 0x00FF & \ + JOM(8, "bumped to: %i=" + "peasycap->" + "field_fill %i=" + "parity\n", + peasycap->field_fill, + 0x00FF & pfield_buffer->kount); - JOM(8, "field buffer %i has "\ - "%i bytes fit to be "\ - "read\n", \ - peasycap->field_read, \ + JOM(8, "field buffer %i has " + "%i bytes fit to be " + "read\n", + peasycap->field_read, videofieldamount); - JOM(8, "wakeup call to "\ - "wq_video, " \ - "%i=field_read "\ - "%i=field_fill "\ - "%i=parity\n", \ - peasycap->field_read, \ - peasycap->field_fill, \ - 0x00FF & peasycap->\ - field_buffer\ - [peasycap->\ + JOM(8, "wakeup call to " + "wq_video, " + "%i=field_read " + "%i=field_fill " + "%i=parity\n", + peasycap->field_read, + peasycap->field_fill, + 0x00FF & peasycap-> + field_buffer + [peasycap-> field_read][0].kount); - wake_up_interruptible\ - (&(peasycap->\ + wake_up_interruptible + (&(peasycap-> wq_video)); - do_gettimeofday\ + do_gettimeofday (&peasycap->timeval7); } else { peasycap->video_junk++; - if (bad & 0x0010) \ - peasycap->video_junk += \ + if (bad & 0x0010) + peasycap->video_junk += (1 + VIDEO_JUNK_TOLERATE/2); - JOM(8, "field buffer %i had %i " \ - "bytes, now discarded: "\ - "0x%04X\n", \ - peasycap->field_fill, \ - videofieldamount,\ - (0xFF00 & \ - peasycap->field_buffer\ - [peasycap->field_fill][0].\ + JOM(8, "field buffer %i had %i " + "bytes, now discarded: " + "0x%04X\n", + peasycap->field_fill, + videofieldamount, + (0xFF00 & + peasycap->field_buffer + [peasycap->field_fill][0]. kount)); (peasycap->field_fill)++; - if (FIELD_BUFFER_MANY <= \ + if (FIELD_BUFFER_MANY <= peasycap->field_fill) peasycap->field_fill = 0; peasycap->field_page = 0; - pfield_buffer = \ - &peasycap->field_buffer\ - [peasycap->field_fill]\ + pfield_buffer = + &peasycap->field_buffer + [peasycap->field_fill] [peasycap->field_page]; - pfield_buffer->pto = \ + pfield_buffer->pto = pfield_buffer->pgo; - JOM(8, "bumped to: %i=peasycap->" \ - "field_fill %i=parity\n", \ - peasycap->field_fill, \ + JOM(8, "bumped to: %i=peasycap->" + "field_fill %i=parity\n", + peasycap->field_fill, 0x00FF & pfield_buffer->kount); } if (8 == more) { - JOM(8, "end-of-field: received " \ - "parity byte 0x%02X\n", \ + JOM(8, "end-of-field: received " + "parity byte 0x%02X\n", (0xFF & *pu)); if (0x40 & *pu) pfield_buffer->kount = 0x0000; else pfield_buffer->kount = 0x0001; - pfield_buffer->input = 0x08 | \ + pfield_buffer->input = 0x08 | (0x07 & peasycap->input); - JOM(8, "end-of-field: 0x%02X=kount\n",\ + JOM(8, "end-of-field: 0x%02X=kount\n", 0xFF & pfield_buffer->kount); } } @@ -3244,49 +3244,49 @@ if (purb->status) { SAM("ERROR: bad peasycap->field_fill\n"); return; } - if (FIELD_BUFFER_SIZE/PAGE_SIZE <= \ + if (FIELD_BUFFER_SIZE/PAGE_SIZE <= peasycap->field_page) { SAM("ERROR: bad peasycap->field_page\n"); return; } - pfield_buffer = &peasycap->field_buffer\ + pfield_buffer = &peasycap->field_buffer [peasycap->field_fill][peasycap->field_page]; while (more) { - pfield_buffer = &peasycap->field_buffer\ - [peasycap->field_fill]\ + pfield_buffer = &peasycap->field_buffer + [peasycap->field_fill] [peasycap->field_page]; - if (PAGE_SIZE < (pfield_buffer->pto - \ + if (PAGE_SIZE < (pfield_buffer->pto - pfield_buffer->pgo)) { SAM("ERROR: bad pfield_buffer->pto\n"); return; } - if (PAGE_SIZE == (pfield_buffer->pto - \ + if (PAGE_SIZE == (pfield_buffer->pto - pfield_buffer->pgo)) { (peasycap->field_page)++; - if (FIELD_BUFFER_SIZE/PAGE_SIZE <= \ + if (FIELD_BUFFER_SIZE/PAGE_SIZE <= peasycap->field_page) { - JOM(16, "wrapping peasycap->" \ + JOM(16, "wrapping peasycap->" "field_page\n"); peasycap->field_page = 0; } - pfield_buffer = &peasycap->\ - field_buffer\ - [peasycap->field_fill]\ + pfield_buffer = &peasycap-> + field_buffer + [peasycap->field_fill] [peasycap->field_page]; - pfield_buffer->pto = \ + pfield_buffer->pto = pfield_buffer->pgo; - pfield_buffer->input = 0x08 | \ + pfield_buffer->input = 0x08 | (0x07 & peasycap->input); - if ((peasycap->field_buffer[peasycap->\ - field_fill][0]).\ - input != \ + if ((peasycap->field_buffer[peasycap-> + field_fill][0]). + input != pfield_buffer->input) - (peasycap->field_buffer\ - [peasycap->field_fill]\ + (peasycap->field_buffer + [peasycap->field_fill] [0]).kount |= 0x1000; } - much = PAGE_SIZE - (int)(pfield_buffer->pto - \ + much = PAGE_SIZE - (int)(pfield_buffer->pto - pfield_buffer->pgo); if (much > more) @@ -3355,10 +3355,10 @@ if (peasycap->video_isoc_streaming) { SAM("0x%08X\n", rc); break; } } - if (-ENODEV != rc) \ - SAM("ERROR: while %i=video_idle, " \ - "usb_submit_urb() " \ - "failed with rc:\n", \ + if (-ENODEV != rc) + SAM("ERROR: while %i=video_idle, " + "usb_submit_urb() " + "failed with rc:\n", peasycap->video_idle); } } @@ -3372,7 +3372,7 @@ return; */ /*---------------------------------------------------------------------------*/ int -easycap_usb_probe(struct usb_interface *pusb_interface, \ +easycap_usb_probe(struct usb_interface *pusb_interface, const struct usb_device_id *pusb_device_id) { struct usb_device *pusb_device, *pusb_device1; @@ -3424,7 +3424,7 @@ peasycap = (struct easycap *)NULL; * GET POINTER TO STRUCTURE usb_device */ /*---------------------------------------------------------------------------*/ -pusb_device1 = container_of(pusb_interface->dev.parent, \ +pusb_device1 = container_of(pusb_interface->dev.parent, struct usb_device, dev); if ((struct usb_device *)NULL == pusb_device1) { SAY("ERROR: pusb_device1 is NULL\n"); @@ -3460,23 +3460,23 @@ bInterfaceNumber = pusb_interface_descriptor->bInterfaceNumber; bInterfaceClass = pusb_interface_descriptor->bInterfaceClass; bInterfaceSubClass = pusb_interface_descriptor->bInterfaceSubClass; -JOT(4, "intf[%i]: pusb_interface->num_altsetting=%i\n", \ +JOT(4, "intf[%i]: pusb_interface->num_altsetting=%i\n", bInterfaceNumber, pusb_interface->num_altsetting); -JOT(4, "intf[%i]: pusb_interface->cur_altsetting - " \ - "pusb_interface->altsetting=%li\n", bInterfaceNumber, \ - (long int)(pusb_interface->cur_altsetting - \ +JOT(4, "intf[%i]: pusb_interface->cur_altsetting - " + "pusb_interface->altsetting=%li\n", bInterfaceNumber, + (long int)(pusb_interface->cur_altsetting - pusb_interface->altsetting)); switch (bInterfaceClass) { case USB_CLASS_AUDIO: { - JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_AUDIO\n", \ + JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_AUDIO\n", bInterfaceNumber, bInterfaceClass); break; } case USB_CLASS_VIDEO: { - JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VIDEO\n", \ + JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VIDEO\n", bInterfaceNumber, bInterfaceClass); break; } case USB_CLASS_VENDOR_SPEC: { - JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VENDOR_SPEC\n", \ + JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VENDOR_SPEC\n", bInterfaceNumber, bInterfaceClass); break; } default: @@ -3484,15 +3484,15 @@ default: } switch (bInterfaceSubClass) { case 0x01: { - JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOCONTROL\n", \ + JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOCONTROL\n", bInterfaceNumber, bInterfaceSubClass); break; } case 0x02: { - JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOSTREAMING\n", \ + JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOSTREAMING\n", bInterfaceNumber, bInterfaceSubClass); break; } case 0x03: { - JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=MIDISTREAMING\n", \ + JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=MIDISTREAMING\n", bInterfaceNumber, bInterfaceSubClass); break; } default: @@ -3501,12 +3501,12 @@ default: /*---------------------------------------------------------------------------*/ pusb_interface_assoc_descriptor = pusb_interface->intf_assoc; if (NULL != pusb_interface_assoc_descriptor) { - JOT(4, "intf[%i]: bFirstInterface=0x%02X bInterfaceCount=0x%02X\n", \ - bInterfaceNumber, \ - pusb_interface_assoc_descriptor->bFirstInterface, \ + JOT(4, "intf[%i]: bFirstInterface=0x%02X bInterfaceCount=0x%02X\n", + bInterfaceNumber, + pusb_interface_assoc_descriptor->bFirstInterface, pusb_interface_assoc_descriptor->bInterfaceCount); } else { -JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n", \ +JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n", bInterfaceNumber); } /*---------------------------------------------------------------------------*/ @@ -3529,10 +3529,10 @@ if (0 == bInterfaceNumber) { SAM("allocated 0x%08lX=peasycap\n", (unsigned long int) peasycap); /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ #if defined(EASYCAP_IS_VIDEODEV_CLIENT) - SAM("where 0x%08lX=&peasycap->video_device\n", \ + SAM("where 0x%08lX=&peasycap->video_device\n", (unsigned long int) &peasycap->video_device); #if defined(EASYCAP_NEEDS_V4L2_DEVICE_H) - SAM("and 0x%08lX=&peasycap->v4l2_device\n", \ + SAM("and 0x%08lX=&peasycap->v4l2_device\n", (unsigned long int) &peasycap->v4l2_device); #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ @@ -3545,8 +3545,8 @@ if (0 == bInterfaceNumber) { peasycap->minor = -1; strcpy(&peasycap->telltale[0], TELLTALE); kref_init(&peasycap->kref); - JOM(8, "intf[%i]: after kref_init(..._video) " \ - "%i=peasycap->kref.refcount.counter\n", \ + JOM(8, "intf[%i]: after kref_init(..._video) " + "%i=peasycap->kref.refcount.counter\n", bInterfaceNumber, peasycap->kref.refcount.counter); /* module params */ @@ -3571,15 +3571,15 @@ if (0 == bInterfaceNumber) { */ /*---------------------------------------------------------------------------*/ for (ndong = 0; ndong < DONGLE_MANY; ndong++) { - if ((NULL == easycapdc60_dongle[ndong].peasycap) && \ - (!mutex_is_locked(&easycapdc60_dongle\ - [ndong].mutex_video)) && \ - (!mutex_is_locked(&easycapdc60_dongle\ + if ((NULL == easycapdc60_dongle[ndong].peasycap) && + (!mutex_is_locked(&easycapdc60_dongle + [ndong].mutex_video)) && + (!mutex_is_locked(&easycapdc60_dongle [ndong].mutex_audio))) { easycapdc60_dongle[ndong].peasycap = peasycap; peasycap->isdongle = ndong; - JOM(8, "intf[%i]: peasycap-->easycap" \ - "_dongle[%i].peasycap\n", \ + JOM(8, "intf[%i]: peasycap-->easycap" + "_dongle[%i].peasycap\n", bInterfaceNumber, ndong); break; } @@ -3660,11 +3660,11 @@ if (0 == bInterfaceNumber) { m = 0; mask = 0; while (0xFFFF != easycap_standard[i].mask) { - if (NTSC_M == easycap_standard[i].\ + if (NTSC_M == easycap_standard[i]. v4l2_standard.index) { m++; for (k = 0; k < INPUT_MANY; k++) { - peasycap->inputset[k].\ + peasycap->inputset[k]. standard_offset = i; } mask = easycap_standard[i].mask; @@ -3676,11 +3676,11 @@ if (0 == bInterfaceNumber) { m = 0; mask = 0; while (0xFFFF != easycap_standard[i].mask) { - if (PAL_BGHIN == easycap_standard[i].\ + if (PAL_BGHIN == easycap_standard[i]. v4l2_standard.index) { m++; for (k = 0; k < INPUT_MANY; k++) { - peasycap->inputset[k].\ + peasycap->inputset[k]. standard_offset = i; } mask = easycap_standard[i].mask; @@ -3690,7 +3690,7 @@ if (0 == bInterfaceNumber) { } if (1 != m) { - SAM("MISTAKE: easycap.inputset[].standard_offset " \ + SAM("MISTAKE: easycap.inputset[].standard_offset " "unpopulated, %i=m\n", m); return -ENOENT; } @@ -3699,17 +3699,17 @@ if (0 == bInterfaceNumber) { i = 0; m = 0; while (0 != peasycap_format->v4l2_format.fmt.pix.width) { - if (((peasycap_format->mask & 0x0F) == (mask & 0x0F)) && \ - (peasycap_format->\ - v4l2_format.fmt.pix.field == \ - V4L2_FIELD_NONE) && \ - (peasycap_format->\ - v4l2_format.fmt.pix.pixelformat == \ - V4L2_PIX_FMT_UYVY) && \ - (peasycap_format->\ - v4l2_format.fmt.pix.width == \ - 640) && \ - (peasycap_format->\ + if (((peasycap_format->mask & 0x0F) == (mask & 0x0F)) && + (peasycap_format-> + v4l2_format.fmt.pix.field == + V4L2_FIELD_NONE) && + (peasycap_format-> + v4l2_format.fmt.pix.pixelformat == + V4L2_PIX_FMT_UYVY) && + (peasycap_format-> + v4l2_format.fmt.pix.width == + 640) && + (peasycap_format-> v4l2_format.fmt.pix.height == 480)) { m++; for (k = 0; k < INPUT_MANY; k++) @@ -3748,7 +3748,7 @@ if (0 == bInterfaceNumber) { i++; } if (4 != m) { - SAM("MISTAKE: easycap.inputset[].brightness,... " \ + SAM("MISTAKE: easycap.inputset[].brightness,... " "underpopulated\n"); return -ENOENT; } @@ -3766,21 +3766,21 @@ if (0 == bInterfaceNumber) { */ /*---------------------------------------------------------------------------*/ for (ndong = 0; ndong < DONGLE_MANY; ndong++) { - if (pusb_device == easycapdc60_dongle[ndong].peasycap->\ + if (pusb_device == easycapdc60_dongle[ndong].peasycap-> pusb_device) { peasycap = easycapdc60_dongle[ndong].peasycap; - JOT(8, "intf[%i]: easycapdc60_dongle[%i].peasycap-->" \ + JOT(8, "intf[%i]: easycapdc60_dongle[%i].peasycap-->" "peasycap\n", bInterfaceNumber, ndong); break; } } if (DONGLE_MANY <= ndong) { - SAY("ERROR: peasycap is unknown when probing interface %i\n", \ + SAY("ERROR: peasycap is unknown when probing interface %i\n", bInterfaceNumber); return -ENODEV; } if (NULL == peasycap) { - SAY("ERROR: peasycap is NULL when probing interface %i\n", \ + SAY("ERROR: peasycap is NULL when probing interface %i\n", bInterfaceNumber); return -ENODEV; } @@ -3803,40 +3803,40 @@ if (0 == bInterfaceNumber) { SAY("ERROR: pv4l2_device is NULL\n"); return -ENODEV; } - peasycap = (struct easycap *) \ + peasycap = (struct easycap *) container_of(pv4l2_device, struct easycap, v4l2_device); } #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ } /*---------------------------------------------------------------------------*/ -if ((USB_CLASS_VIDEO == bInterfaceClass) || \ +if ((USB_CLASS_VIDEO == bInterfaceClass) || (USB_CLASS_VENDOR_SPEC == bInterfaceClass)) { if (-1 == peasycap->video_interface) { peasycap->video_interface = bInterfaceNumber; - JOM(4, "setting peasycap->video_interface=%i\n", \ + JOM(4, "setting peasycap->video_interface=%i\n", peasycap->video_interface); } else { if (peasycap->video_interface != bInterfaceNumber) { - SAM("ERROR: attempting to reset " \ + SAM("ERROR: attempting to reset " "peasycap->video_interface\n"); - SAM("...... continuing with " \ - "%i=peasycap->video_interface\n", \ + SAM("...... continuing with " + "%i=peasycap->video_interface\n", peasycap->video_interface); } } -} else if ((USB_CLASS_AUDIO == bInterfaceClass) && \ +} else if ((USB_CLASS_AUDIO == bInterfaceClass) && (0x02 == bInterfaceSubClass)) { if (-1 == peasycap->audio_interface) { peasycap->audio_interface = bInterfaceNumber; - JOM(4, "setting peasycap->audio_interface=%i\n", \ + JOM(4, "setting peasycap->audio_interface=%i\n", peasycap->audio_interface); } else { if (peasycap->audio_interface != bInterfaceNumber) { - SAM("ERROR: attempting to reset " \ + SAM("ERROR: attempting to reset " "peasycap->audio_interface\n"); - SAM("...... continuing with " \ - "%i=peasycap->audio_interface\n", \ + SAM("...... continuing with " + "%i=peasycap->audio_interface\n", peasycap->audio_interface); } } @@ -3856,27 +3856,27 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) { return -EFAULT; } pusb_interface_descriptor = &(pusb_host_interface->desc); - if ((struct usb_interface_descriptor *)NULL == \ + if ((struct usb_interface_descriptor *)NULL == pusb_interface_descriptor) { SAM("ERROR: pusb_interface_descriptor is NULL\n"); return -EFAULT; } - JOM(4, "intf[%i]alt[%i]: desc.bDescriptorType=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.bDescriptorType=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->bDescriptorType); - JOM(4, "intf[%i]alt[%i]: desc.bInterfaceNumber=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.bInterfaceNumber=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceNumber); - JOM(4, "intf[%i]alt[%i]: desc.bAlternateSetting=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.bAlternateSetting=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->bAlternateSetting); - JOM(4, "intf[%i]alt[%i]: desc.bNumEndpoints=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.bNumEndpoints=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->bNumEndpoints); - JOM(4, "intf[%i]alt[%i]: desc.bInterfaceClass=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.bInterfaceClass=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceClass); - JOM(4, "intf[%i]alt[%i]: desc.bInterfaceSubClass=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.bInterfaceSubClass=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceSubClass); - JOM(4, "intf[%i]alt[%i]: desc.bInterfaceProtocol=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.bInterfaceProtocol=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceProtocol); - JOM(4, "intf[%i]alt[%i]: desc.iInterface=0x%02X\n", \ + JOM(4, "intf[%i]alt[%i]: desc.iInterface=0x%02X\n", bInterfaceNumber, i, pusb_interface_descriptor->iInterface); ISOCwMaxPacketSize = -1; @@ -3887,7 +3887,7 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) { INTbEndpointAddress = 0; if (0 == pusb_interface_descriptor->bNumEndpoints) - JOM(4, "intf[%i]alt[%i] has no endpoints\n", \ + JOM(4, "intf[%i]alt[%i] has no endpoints\n", bInterfaceNumber, i); /*---------------------------------------------------------------------------*/ for (j = 0; j < pusb_interface_descriptor->bNumEndpoints; j++) { @@ -3900,88 +3900,88 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) { wMaxPacketSize = le16_to_cpu(pepd->wMaxPacketSize); bEndpointAddress = pepd->bEndpointAddress; - JOM(4, "intf[%i]alt[%i]end[%i]: bEndpointAddress=0x%X\n", \ - bInterfaceNumber, i, j, \ + JOM(4, "intf[%i]alt[%i]end[%i]: bEndpointAddress=0x%X\n", + bInterfaceNumber, i, j, pepd->bEndpointAddress); - JOM(4, "intf[%i]alt[%i]end[%i]: bmAttributes=0x%X\n", \ - bInterfaceNumber, i, j, \ + JOM(4, "intf[%i]alt[%i]end[%i]: bmAttributes=0x%X\n", + bInterfaceNumber, i, j, pepd->bmAttributes); - JOM(4, "intf[%i]alt[%i]end[%i]: wMaxPacketSize=%i\n", \ - bInterfaceNumber, i, j, \ + JOM(4, "intf[%i]alt[%i]end[%i]: wMaxPacketSize=%i\n", + bInterfaceNumber, i, j, pepd->wMaxPacketSize); JOM(4, "intf[%i]alt[%i]end[%i]: bInterval=%i\n", - bInterfaceNumber, i, j, \ + bInterfaceNumber, i, j, pepd->bInterval); if (pepd->bEndpointAddress & USB_DIR_IN) { - JOM(4, "intf[%i]alt[%i]end[%i] is an IN endpoint\n",\ + JOM(4, "intf[%i]alt[%i]end[%i] is an IN endpoint\n", bInterfaceNumber, i, j); isin = 1; } else { - JOM(4, "intf[%i]alt[%i]end[%i] is an OUT endpoint\n",\ + JOM(4, "intf[%i]alt[%i]end[%i] is an OUT endpoint\n", bInterfaceNumber, i, j); SAM("ERROR: OUT endpoint unexpected\n"); SAM("...... continuing\n"); isin = 0; } - if ((pepd->bmAttributes & \ - USB_ENDPOINT_XFERTYPE_MASK) == \ + if ((pepd->bmAttributes & + USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_ISOC) { - JOM(4, "intf[%i]alt[%i]end[%i] is an ISOC endpoint\n",\ + JOM(4, "intf[%i]alt[%i]end[%i] is an ISOC endpoint\n", bInterfaceNumber, i, j); if (isin) { switch (bInterfaceClass) { case USB_CLASS_VIDEO: case USB_CLASS_VENDOR_SPEC: { if (!peasycap) { - SAM("MISTAKE: " \ + SAM("MISTAKE: " "peasycap is NULL\n"); return -EFAULT; } if (pepd->wMaxPacketSize) { if (8 > isokalt) { okalt[isokalt] = i; - JOM(4,\ - "%i=okalt[%i]\n", \ - okalt[isokalt], \ + JOM(4, + "%i=okalt[%i]\n", + okalt[isokalt], isokalt); - okepn[isokalt] = \ - pepd->\ - bEndpointAddress & \ + okepn[isokalt] = + pepd-> + bEndpointAddress & 0x0F; - JOM(4,\ - "%i=okepn[%i]\n", \ - okepn[isokalt], \ + JOM(4, + "%i=okepn[%i]\n", + okepn[isokalt], isokalt); - okmps[isokalt] = \ - le16_to_cpu(pepd->\ + okmps[isokalt] = + le16_to_cpu(pepd-> wMaxPacketSize); - JOM(4,\ - "%i=okmps[%i]\n", \ - okmps[isokalt], \ + JOM(4, + "%i=okmps[%i]\n", + okmps[isokalt], isokalt); isokalt++; } } else { - if (-1 == peasycap->\ + if (-1 == peasycap-> video_altsetting_off) { - peasycap->\ - video_altsetting_off =\ + peasycap-> + video_altsetting_off = i; - JOM(4, "%i=video_" \ - "altsetting_off " \ - "<====\n", \ - peasycap->\ + JOM(4, "%i=video_" + "altsetting_off " + "<====\n", + peasycap-> video_altsetting_off); } else { - SAM("ERROR: peasycap" \ - "->video_altsetting_" \ + SAM("ERROR: peasycap" + "->video_altsetting_" "off already set\n"); - SAM("...... " \ - "continuing with " \ - "%i=peasycap->video_" \ - "altsetting_off\n", \ - peasycap->\ + SAM("...... " + "continuing with " + "%i=peasycap->video_" + "altsetting_off\n", + peasycap-> video_altsetting_off); } } @@ -3991,55 +3991,55 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) { if (0x02 != bInterfaceSubClass) break; if (!peasycap) { - SAM("MISTAKE: " \ + SAM("MISTAKE: " "peasycap is NULL\n"); return -EFAULT; } if (pepd->wMaxPacketSize) { if (8 > isokalt) { okalt[isokalt] = i ; - JOM(4,\ - "%i=okalt[%i]\n", \ - okalt[isokalt], \ + JOM(4, + "%i=okalt[%i]\n", + okalt[isokalt], isokalt); - okepn[isokalt] = \ - pepd->\ - bEndpointAddress & \ + okepn[isokalt] = + pepd-> + bEndpointAddress & 0x0F; - JOM(4,\ - "%i=okepn[%i]\n", \ - okepn[isokalt], \ + JOM(4, + "%i=okepn[%i]\n", + okepn[isokalt], isokalt); - okmps[isokalt] = \ - le16_to_cpu(pepd->\ + okmps[isokalt] = + le16_to_cpu(pepd-> wMaxPacketSize); - JOM(4,\ - "%i=okmps[%i]\n",\ - okmps[isokalt], \ + JOM(4, + "%i=okmps[%i]\n", + okmps[isokalt], isokalt); isokalt++; } } else { - if (-1 == peasycap->\ + if (-1 == peasycap-> audio_altsetting_off) { - peasycap->\ - audio_altsetting_off =\ + peasycap-> + audio_altsetting_off = i; - JOM(4, "%i=audio_" \ - "altsetting_off " \ - "<====\n", \ - peasycap->\ + JOM(4, "%i=audio_" + "altsetting_off " + "<====\n", + peasycap-> audio_altsetting_off); } else { - SAM("ERROR: peasycap" \ - "->audio_altsetting_" \ + SAM("ERROR: peasycap" + "->audio_altsetting_" "off already set\n"); - SAM("...... " \ - "continuing with " \ - "%i=peasycap->\ - audio_altsetting_" \ + SAM("...... " + "continuing with " + "%i=peasycap->" + "audio_altsetting_" "off\n", - peasycap->\ + peasycap-> audio_altsetting_off); } } @@ -4049,23 +4049,23 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) { break; } } - } else if ((pepd->bmAttributes & \ - USB_ENDPOINT_XFERTYPE_MASK) ==\ + } else if ((pepd->bmAttributes & + USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) { - JOM(4, "intf[%i]alt[%i]end[%i] is a BULK endpoint\n",\ + JOM(4, "intf[%i]alt[%i]end[%i] is a BULK endpoint\n", bInterfaceNumber, i, j); - } else if ((pepd->bmAttributes & \ - USB_ENDPOINT_XFERTYPE_MASK) ==\ + } else if ((pepd->bmAttributes & + USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) { - JOM(4, "intf[%i]alt[%i]end[%i] is an INT endpoint\n",\ + JOM(4, "intf[%i]alt[%i]end[%i] is an INT endpoint\n", bInterfaceNumber, i, j); } else { - JOM(4, "intf[%i]alt[%i]end[%i] is a CTRL endpoint\n",\ + JOM(4, "intf[%i]alt[%i]end[%i] is a CTRL endpoint\n", bInterfaceNumber, i, j); } if (0 == pepd->wMaxPacketSize) { - JOM(4, "intf[%i]alt[%i]end[%i] " \ - "has zero packet size\n", \ + JOM(4, "intf[%i]alt[%i]end[%i] " + "has zero packet size\n", bInterfaceNumber, i, j); } } @@ -4075,7 +4075,7 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) { * PERFORM INITIALIZATION OF THE PROBED INTERFACE */ /*---------------------------------------------------------------------------*/ -JOM(4, "initialization begins for interface %i\n", \ +JOM(4, "initialization begins for interface %i\n", pusb_interface_descriptor->bInterfaceNumber); switch (bInterfaceNumber) { /*---------------------------------------------------------------------------*/ @@ -4093,7 +4093,7 @@ case 0: { return -ENOENT; } else { peasycap->video_altsetting_on = okalt[isokalt - 1]; - JOM(4, "%i=video_altsetting_on <====\n", \ + JOM(4, "%i=video_altsetting_on <====\n", peasycap->video_altsetting_on); } /*---------------------------------------------------------------------------*/ @@ -4107,10 +4107,10 @@ case 0: { if (USB_2_0_MAXPACKETSIZE > maxpacketsize) { peasycap->video_isoc_maxframesize = maxpacketsize; } else { - peasycap->video_isoc_maxframesize = \ + peasycap->video_isoc_maxframesize = USB_2_0_MAXPACKETSIZE; } - JOM(4, "%i=video_isoc_maxframesize\n", \ + JOM(4, "%i=video_isoc_maxframesize\n", peasycap->video_isoc_maxframesize); if (0 >= peasycap->video_isoc_maxframesize) { SAM("ERROR: bad video_isoc_maxframesize\n"); @@ -4118,18 +4118,18 @@ case 0: { return -ENOENT; } peasycap->video_isoc_framesperdesc = VIDEO_ISOC_FRAMESPERDESC; - JOM(4, "%i=video_isoc_framesperdesc\n", \ + JOM(4, "%i=video_isoc_framesperdesc\n", peasycap->video_isoc_framesperdesc); if (0 >= peasycap->video_isoc_framesperdesc) { SAM("ERROR: bad video_isoc_framesperdesc\n"); return -ENOENT; } - peasycap->video_isoc_buffer_size = \ - peasycap->video_isoc_maxframesize * \ + peasycap->video_isoc_buffer_size = + peasycap->video_isoc_maxframesize * peasycap->video_isoc_framesperdesc; - JOM(4, "%i=video_isoc_buffer_size\n", \ + JOM(4, "%i=video_isoc_buffer_size\n", peasycap->video_isoc_buffer_size); - if ((PAGE_SIZE << VIDEO_ISOC_ORDER) < \ + if ((PAGE_SIZE << VIDEO_ISOC_ORDER) < peasycap->video_isoc_buffer_size) { SAM("MISTAKE: peasycap->video_isoc_buffer_size too big\n"); return -EFAULT; @@ -4167,50 +4167,50 @@ case 0: { INIT_LIST_HEAD(&(peasycap->urb_video_head)); peasycap->purb_video_head = &(peasycap->urb_video_head); /*---------------------------------------------------------------------------*/ - JOM(4, "allocating %i frame buffers of size %li\n", \ + JOM(4, "allocating %i frame buffers of size %li\n", FRAME_BUFFER_MANY, (long int)FRAME_BUFFER_SIZE); - JOM(4, ".... each scattered over %li pages\n", \ + JOM(4, ".... each scattered over %li pages\n", FRAME_BUFFER_SIZE/PAGE_SIZE); for (k = 0; k < FRAME_BUFFER_MANY; k++) { for (m = 0; m < FRAME_BUFFER_SIZE/PAGE_SIZE; m++) { if ((void *)NULL != peasycap->frame_buffer[k][m].pgo) - SAM("attempting to reallocate frame " \ + SAM("attempting to reallocate frame " " buffers\n"); else { pbuf = (void *)__get_free_page(GFP_KERNEL); if ((void *)NULL == pbuf) { - SAM("ERROR: Could not allocate frame "\ + SAM("ERROR: Could not allocate frame " "buffer %i page %i\n", k, m); return -ENOMEM; } else peasycap->allocation_video_page += 1; peasycap->frame_buffer[k][m].pgo = pbuf; } - peasycap->frame_buffer[k][m].pto = \ + peasycap->frame_buffer[k][m].pto = peasycap->frame_buffer[k][m].pgo; } } peasycap->frame_fill = 0; peasycap->frame_read = 0; - JOM(4, "allocation of frame buffers done: %i pages\n", k * \ + JOM(4, "allocation of frame buffers done: %i pages\n", k * m); /*---------------------------------------------------------------------------*/ - JOM(4, "allocating %i field buffers of size %li\n", \ + JOM(4, "allocating %i field buffers of size %li\n", FIELD_BUFFER_MANY, (long int)FIELD_BUFFER_SIZE); - JOM(4, ".... each scattered over %li pages\n", \ + JOM(4, ".... each scattered over %li pages\n", FIELD_BUFFER_SIZE/PAGE_SIZE); for (k = 0; k < FIELD_BUFFER_MANY; k++) { for (m = 0; m < FIELD_BUFFER_SIZE/PAGE_SIZE; m++) { if ((void *)NULL != peasycap->field_buffer[k][m].pgo) { - SAM("ERROR: attempting to reallocate " \ + SAM("ERROR: attempting to reallocate " "field buffers\n"); } else { pbuf = (void *) __get_free_page(GFP_KERNEL); if ((void *)NULL == pbuf) { - SAM("ERROR: Could not allocate field" \ + SAM("ERROR: Could not allocate field" " buffer %i page %i\n", k, m); return -ENOMEM; } @@ -4218,7 +4218,7 @@ case 0: { peasycap->allocation_video_page += 1; peasycap->field_buffer[k][m].pgo = pbuf; } - peasycap->field_buffer[k][m].pto = \ + peasycap->field_buffer[k][m].pto = peasycap->field_buffer[k][m].pgo; } peasycap->field_buffer[k][0].kount = 0x0200; @@ -4226,30 +4226,30 @@ case 0: { peasycap->field_fill = 0; peasycap->field_page = 0; peasycap->field_read = 0; - JOM(4, "allocation of field buffers done: %i pages\n", k * \ + JOM(4, "allocation of field buffers done: %i pages\n", k * m); /*---------------------------------------------------------------------------*/ - JOM(4, "allocating %i isoc video buffers of size %i\n", \ - VIDEO_ISOC_BUFFER_MANY, \ + JOM(4, "allocating %i isoc video buffers of size %i\n", + VIDEO_ISOC_BUFFER_MANY, peasycap->video_isoc_buffer_size); JOM(4, ".... each occupying contiguous memory pages\n"); for (k = 0; k < VIDEO_ISOC_BUFFER_MANY; k++) { pbuf = (void *)__get_free_pages(GFP_KERNEL, VIDEO_ISOC_ORDER); if (NULL == pbuf) { - SAM("ERROR: Could not allocate isoc video buffer " \ + SAM("ERROR: Could not allocate isoc video buffer " "%i\n", k); return -ENOMEM; } else - peasycap->allocation_video_page += \ + peasycap->allocation_video_page += ((unsigned int)(0x01 << VIDEO_ISOC_ORDER)); peasycap->video_isoc_buffer[k].pgo = pbuf; - peasycap->video_isoc_buffer[k].pto = pbuf + \ + peasycap->video_isoc_buffer[k].pto = pbuf + peasycap->video_isoc_buffer_size; peasycap->video_isoc_buffer[k].kount = k; } - JOM(4, "allocation of isoc video buffers done: %i pages\n", \ + JOM(4, "allocation of isoc video buffers done: %i pages\n", k * (0x01 << VIDEO_ISOC_ORDER)); /*---------------------------------------------------------------------------*/ /* @@ -4257,18 +4257,18 @@ case 0: { */ /*---------------------------------------------------------------------------*/ JOM(4, "allocating %i struct urb.\n", VIDEO_ISOC_BUFFER_MANY); - JOM(4, "using %i=peasycap->video_isoc_framesperdesc\n", \ + JOM(4, "using %i=peasycap->video_isoc_framesperdesc\n", peasycap->video_isoc_framesperdesc); - JOM(4, "using %i=peasycap->video_isoc_maxframesize\n", \ + JOM(4, "using %i=peasycap->video_isoc_maxframesize\n", peasycap->video_isoc_maxframesize); - JOM(4, "using %i=peasycap->video_isoc_buffer_sizen", \ + JOM(4, "using %i=peasycap->video_isoc_buffer_sizen", peasycap->video_isoc_buffer_size); for (k = 0; k < VIDEO_ISOC_BUFFER_MANY; k++) { - purb = usb_alloc_urb(peasycap->video_isoc_framesperdesc, \ + purb = usb_alloc_urb(peasycap->video_isoc_framesperdesc, GFP_KERNEL); if (NULL == purb) { - SAM("ERROR: usb_alloc_urb returned NULL for buffer " \ + SAM("ERROR: usb_alloc_urb returned NULL for buffer " "%i\n", k); return -ENOMEM; } else @@ -4279,13 +4279,13 @@ case 0: { SAM("ERROR: Could not allocate struct data_urb.\n"); return -ENOMEM; } else - peasycap->allocation_video_struct += \ + peasycap->allocation_video_struct += sizeof(struct data_urb); pdata_urb->purb = purb; pdata_urb->isbuf = k; pdata_urb->length = 0; - list_add_tail(&(pdata_urb->list_head), \ + list_add_tail(&(pdata_urb->list_head), peasycap->purb_video_head); /*---------------------------------------------------------------------------*/ /* @@ -4296,45 +4296,45 @@ case 0: { JOM(4, "initializing video urbs thus:\n"); JOM(4, " purb->interval = 1;\n"); JOM(4, " purb->dev = peasycap->pusb_device;\n"); - JOM(4, " purb->pipe = usb_rcvisocpipe" \ - "(peasycap->pusb_device,%i);\n", \ + JOM(4, " purb->pipe = usb_rcvisocpipe" + "(peasycap->pusb_device,%i);\n", peasycap->video_endpointnumber); JOM(4, " purb->transfer_flags = URB_ISO_ASAP;\n"); - JOM(4, " purb->transfer_buffer = peasycap->" \ + JOM(4, " purb->transfer_buffer = peasycap->" "video_isoc_buffer[.].pgo;\n"); - JOM(4, " purb->transfer_buffer_length = %i;\n", \ + JOM(4, " purb->transfer_buffer_length = %i;\n", peasycap->video_isoc_buffer_size); JOM(4, " purb->complete = easycap_complete;\n"); JOM(4, " purb->context = peasycap;\n"); JOM(4, " purb->start_frame = 0;\n"); - JOM(4, " purb->number_of_packets = %i;\n", \ + JOM(4, " purb->number_of_packets = %i;\n", peasycap->video_isoc_framesperdesc); - JOM(4, " for (j = 0; j < %i; j++)\n", \ + JOM(4, " for (j = 0; j < %i; j++)\n", peasycap->video_isoc_framesperdesc); JOM(4, " {\n"); - JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n",\ + JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n", peasycap->video_isoc_maxframesize); - JOM(4, " purb->iso_frame_desc[j].length = %i;\n", \ + JOM(4, " purb->iso_frame_desc[j].length = %i;\n", peasycap->video_isoc_maxframesize); JOM(4, " }\n"); } purb->interval = 1; purb->dev = peasycap->pusb_device; - purb->pipe = usb_rcvisocpipe(peasycap->pusb_device, \ + purb->pipe = usb_rcvisocpipe(peasycap->pusb_device, peasycap->video_endpointnumber); purb->transfer_flags = URB_ISO_ASAP; purb->transfer_buffer = peasycap->video_isoc_buffer[k].pgo; - purb->transfer_buffer_length = \ + purb->transfer_buffer_length = peasycap->video_isoc_buffer_size; purb->complete = easycap_complete; purb->context = peasycap; purb->start_frame = 0; purb->number_of_packets = peasycap->video_isoc_framesperdesc; for (j = 0; j < peasycap->video_isoc_framesperdesc; j++) { - purb->iso_frame_desc[j].offset = j * \ + purb->iso_frame_desc[j].offset = j * peasycap->video_isoc_maxframesize; - purb->iso_frame_desc[j].length = \ + purb->iso_frame_desc[j].length = peasycap->video_isoc_maxframesize; } } @@ -4384,12 +4384,12 @@ case 0: { /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ #else #if defined(EASYCAP_NEEDS_V4L2_DEVICE_H) - if (0 != (v4l2_device_register(&(pusb_interface->dev), \ + if (0 != (v4l2_device_register(&(pusb_interface->dev), &(peasycap->v4l2_device)))) { SAM("v4l2_device_register() failed\n"); return -ENODEV; } else { - JOM(4, "registered device instance: %s\n", \ + JOM(4, "registered device instance: %s\n", &(peasycap->v4l2_device.name[0])); } /*---------------------------------------------------------------------------*/ @@ -4416,14 +4416,14 @@ case 0: { video_set_drvdata(&(peasycap->video_device), (void *)peasycap); - if (0 != (video_register_device(&(peasycap->video_device), \ + if (0 != (video_register_device(&(peasycap->video_device), VFL_TYPE_GRABBER, -1))) { err("Not able to register with videodev"); videodev_release(&(peasycap->video_device)); return -ENODEV; } else { (peasycap->registered_video)++; - SAM("registered with videodev: %i=minor\n", \ + SAM("registered with videodev: %i=minor\n", peasycap->video_device.minor); peasycap->minor = peasycap->video_device.minor; } @@ -4452,7 +4452,7 @@ case 1: { */ /*--------------------------------------------------------------------------*/ usb_set_intfdata(pusb_interface, peasycap); - JOM(4, "no initialization required for interface %i\n", \ + JOM(4, "no initialization required for interface %i\n", pusb_interface_descriptor->bInterfaceNumber); break; } @@ -4470,7 +4470,7 @@ case 2: { return -ENOENT; } else { peasycap->audio_altsetting_on = okalt[isokalt - 1]; - JOM(4, "%i=audio_altsetting_on <====\n", \ + JOM(4, "%i=audio_altsetting_on <====\n", peasycap->audio_altsetting_on); } @@ -4478,7 +4478,7 @@ case 2: { JOM(4, "%i=audio_endpointnumber\n", peasycap->audio_endpointnumber); peasycap->audio_isoc_maxframesize = okmps[isokalt - 1]; - JOM(4, "%i=audio_isoc_maxframesize\n", \ + JOM(4, "%i=audio_isoc_maxframesize\n", peasycap->audio_isoc_maxframesize); if (0 >= peasycap->audio_isoc_maxframesize) { SAM("ERROR: bad audio_isoc_maxframesize\n"); @@ -4496,42 +4496,42 @@ case 2: { peasycap->audio_pages_per_fragment = PAGES_PER_AUDIO_FRAGMENT; } else { SAM("hardware is unidentified:\n"); - SAM("%i=audio_isoc_maxframesize\n", \ + SAM("%i=audio_isoc_maxframesize\n", peasycap->audio_isoc_maxframesize); return -ENOENT; } - peasycap->audio_bytes_per_fragment = \ - peasycap->audio_pages_per_fragment * \ + peasycap->audio_bytes_per_fragment = + peasycap->audio_pages_per_fragment * PAGE_SIZE ; - peasycap->audio_buffer_page_many = (AUDIO_FRAGMENT_MANY * \ + peasycap->audio_buffer_page_many = (AUDIO_FRAGMENT_MANY * peasycap->audio_pages_per_fragment); JOM(4, "%6i=AUDIO_FRAGMENT_MANY\n", AUDIO_FRAGMENT_MANY); - JOM(4, "%6i=audio_pages_per_fragment\n", \ + JOM(4, "%6i=audio_pages_per_fragment\n", peasycap->audio_pages_per_fragment); - JOM(4, "%6i=audio_bytes_per_fragment\n", \ + JOM(4, "%6i=audio_bytes_per_fragment\n", peasycap->audio_bytes_per_fragment); - JOM(4, "%6i=audio_buffer_page_many\n", \ + JOM(4, "%6i=audio_buffer_page_many\n", peasycap->audio_buffer_page_many); peasycap->audio_isoc_framesperdesc = AUDIO_ISOC_FRAMESPERDESC; - JOM(4, "%i=audio_isoc_framesperdesc\n", \ + JOM(4, "%i=audio_isoc_framesperdesc\n", peasycap->audio_isoc_framesperdesc); if (0 >= peasycap->audio_isoc_framesperdesc) { SAM("ERROR: bad audio_isoc_framesperdesc\n"); return -ENOENT; } - peasycap->audio_isoc_buffer_size = \ - peasycap->audio_isoc_maxframesize * \ + peasycap->audio_isoc_buffer_size = + peasycap->audio_isoc_maxframesize * peasycap->audio_isoc_framesperdesc; - JOM(4, "%i=audio_isoc_buffer_size\n", \ + JOM(4, "%i=audio_isoc_buffer_size\n", peasycap->audio_isoc_buffer_size); if (AUDIO_ISOC_BUFFER_SIZE < peasycap->audio_isoc_buffer_size) { SAM("MISTAKE: audio_isoc_buffer_size bigger " - "than %li=AUDIO_ISOC_BUFFER_SIZE\n", \ + "than %li=AUDIO_ISOC_BUFFER_SIZE\n", AUDIO_ISOC_BUFFER_SIZE); return -EFAULT; } @@ -4569,7 +4569,7 @@ case 2: { #if !defined(EASYCAP_NEEDS_ALSA) JOM(4, "allocating an audio buffer\n"); - JOM(4, ".... scattered over %i pages\n", \ + JOM(4, ".... scattered over %i pages\n", peasycap->audio_buffer_page_many); for (k = 0; k < peasycap->audio_buffer_page_many; k++) { @@ -4578,7 +4578,7 @@ case 2: { } else { pbuf = (void *) __get_free_page(GFP_KERNEL); if ((void *)NULL == pbuf) { - SAM("ERROR: Could not allocate audio " \ + SAM("ERROR: Could not allocate audio " "buffer page %i\n", k); return -ENOMEM; } else @@ -4594,22 +4594,22 @@ case 2: { JOM(4, "allocation of audio buffer done: %i pages\n", k); #endif /*!EASYCAP_NEEDS_ALSA*/ /*---------------------------------------------------------------------------*/ - JOM(4, "allocating %i isoc audio buffers of size %i\n", \ + JOM(4, "allocating %i isoc audio buffers of size %i\n", AUDIO_ISOC_BUFFER_MANY, peasycap->audio_isoc_buffer_size); JOM(4, ".... each occupying contiguous memory pages\n"); for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) { pbuf = (void *)__get_free_pages(GFP_KERNEL, AUDIO_ISOC_ORDER); if (NULL == pbuf) { - SAM("ERROR: Could not allocate isoc audio buffer " \ + SAM("ERROR: Could not allocate isoc audio buffer " "%i\n", k); return -ENOMEM; } else - peasycap->allocation_audio_page += \ + peasycap->allocation_audio_page += ((unsigned int)(0x01 << AUDIO_ISOC_ORDER)); peasycap->audio_isoc_buffer[k].pgo = pbuf; - peasycap->audio_isoc_buffer[k].pto = pbuf + \ + peasycap->audio_isoc_buffer[k].pto = pbuf + peasycap->audio_isoc_buffer_size; peasycap->audio_isoc_buffer[k].kount = k; } @@ -4620,18 +4620,18 @@ case 2: { */ /*---------------------------------------------------------------------------*/ JOM(4, "allocating %i struct urb.\n", AUDIO_ISOC_BUFFER_MANY); - JOM(4, "using %i=peasycap->audio_isoc_framesperdesc\n", \ + JOM(4, "using %i=peasycap->audio_isoc_framesperdesc\n", peasycap->audio_isoc_framesperdesc); - JOM(4, "using %i=peasycap->audio_isoc_maxframesize\n", \ + JOM(4, "using %i=peasycap->audio_isoc_maxframesize\n", peasycap->audio_isoc_maxframesize); - JOM(4, "using %i=peasycap->audio_isoc_buffer_size\n", \ + JOM(4, "using %i=peasycap->audio_isoc_buffer_size\n", peasycap->audio_isoc_buffer_size); for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) { - purb = usb_alloc_urb(peasycap->audio_isoc_framesperdesc, \ + purb = usb_alloc_urb(peasycap->audio_isoc_framesperdesc, GFP_KERNEL); if (NULL == purb) { - SAM("ERROR: usb_alloc_urb returned NULL for buffer " \ + SAM("ERROR: usb_alloc_urb returned NULL for buffer " "%i\n", k); return -ENOMEM; } else @@ -4642,13 +4642,13 @@ case 2: { SAM("ERROR: Could not allocate struct data_urb.\n"); return -ENOMEM; } else - peasycap->allocation_audio_struct += \ + peasycap->allocation_audio_struct += sizeof(struct data_urb); pdata_urb->purb = purb; pdata_urb->isbuf = k; pdata_urb->length = 0; - list_add_tail(&(pdata_urb->list_head), \ + list_add_tail(&(pdata_urb->list_head), peasycap->purb_audio_head); /*---------------------------------------------------------------------------*/ /* @@ -4659,13 +4659,13 @@ case 2: { JOM(4, "initializing audio urbs thus:\n"); JOM(4, " purb->interval = 1;\n"); JOM(4, " purb->dev = peasycap->pusb_device;\n"); - JOM(4, " purb->pipe = usb_rcvisocpipe(peasycap->" \ - "pusb_device,%i);\n", \ + JOM(4, " purb->pipe = usb_rcvisocpipe(peasycap->" + "pusb_device,%i);\n", peasycap->audio_endpointnumber); JOM(4, " purb->transfer_flags = URB_ISO_ASAP;\n"); - JOM(4, " purb->transfer_buffer = " \ + JOM(4, " purb->transfer_buffer = " "peasycap->audio_isoc_buffer[.].pgo;\n"); - JOM(4, " purb->transfer_buffer_length = %i;\n", \ + JOM(4, " purb->transfer_buffer_length = %i;\n", peasycap->audio_isoc_buffer_size); #if defined(EASYCAP_NEEDS_ALSA) JOM(4, " purb->complete = easycap_alsa_complete;\n"); @@ -4674,25 +4674,25 @@ case 2: { #endif /*EASYCAP_NEEDS_ALSA*/ JOM(4, " purb->context = peasycap;\n"); JOM(4, " purb->start_frame = 0;\n"); - JOM(4, " purb->number_of_packets = %i;\n", \ + JOM(4, " purb->number_of_packets = %i;\n", peasycap->audio_isoc_framesperdesc); - JOM(4, " for (j = 0; j < %i; j++)\n", \ + JOM(4, " for (j = 0; j < %i; j++)\n", peasycap->audio_isoc_framesperdesc); JOM(4, " {\n"); - JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n",\ + JOM(4, " purb->iso_frame_desc[j].offset = j*%i;\n", peasycap->audio_isoc_maxframesize); - JOM(4, " purb->iso_frame_desc[j].length = %i;\n", \ + JOM(4, " purb->iso_frame_desc[j].length = %i;\n", peasycap->audio_isoc_maxframesize); JOM(4, " }\n"); } purb->interval = 1; purb->dev = peasycap->pusb_device; - purb->pipe = usb_rcvisocpipe(peasycap->pusb_device, \ + purb->pipe = usb_rcvisocpipe(peasycap->pusb_device, peasycap->audio_endpointnumber); purb->transfer_flags = URB_ISO_ASAP; purb->transfer_buffer = peasycap->audio_isoc_buffer[k].pgo; - purb->transfer_buffer_length = \ + purb->transfer_buffer_length = peasycap->audio_isoc_buffer_size; #if defined(EASYCAP_NEEDS_ALSA) purb->complete = easycap_alsa_complete; @@ -4703,9 +4703,9 @@ case 2: { purb->start_frame = 0; purb->number_of_packets = peasycap->audio_isoc_framesperdesc; for (j = 0; j < peasycap->audio_isoc_framesperdesc; j++) { - purb->iso_frame_desc[j].offset = j * \ + purb->iso_frame_desc[j].offset = j * peasycap->audio_isoc_maxframesize; - purb->iso_frame_desc[j].length = \ + purb->iso_frame_desc[j].length = peasycap->audio_isoc_maxframesize; } } @@ -4729,7 +4729,7 @@ case 2: { err("easycap_alsa_probe() returned %i\n", rc); return -ENODEV; } else { - JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n",\ + JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n", (int)peasycap->kref.refcount.counter); kref_get(&peasycap->kref); (peasycap->registered_audio)++; @@ -4742,7 +4742,7 @@ case 2: { usb_set_intfdata(pusb_interface, NULL); return -ENODEV; } else { - JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n",\ + JOM(8, "kref_get() with %i=peasycap->kref.refcount.counter\n", (int)peasycap->kref.refcount.counter); kref_get(&peasycap->kref); (peasycap->registered_audio)++; @@ -4767,7 +4767,7 @@ default: { return -EINVAL; } } -SAM("ends successfully for interface %i\n", \ +SAM("ends successfully for interface %i\n", pusb_interface_descriptor->bInterfaceNumber); return 0; } @@ -4847,7 +4847,7 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { SAY("ERROR: pv4l2_device is NULL\n"); return; } - peasycap = (struct easycap *) \ + peasycap = (struct easycap *) container_of(pv4l2_device, struct easycap, v4l2_device); } #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ @@ -4876,10 +4876,10 @@ case 0: { m = 0; list_for_each(plist_head, (peasycap->purb_video_head)) { - pdata_urb = list_entry(plist_head, \ + pdata_urb = list_entry(plist_head, struct data_urb, list_head); if ((struct data_urb *)NULL != pdata_urb) { - if ((struct urb *)NULL != \ + if ((struct urb *)NULL != pdata_urb->purb) { usb_kill_urb(pdata_urb->purb); m++; @@ -4895,12 +4895,12 @@ case 2: { if ((struct list_head *)NULL != peasycap->purb_audio_head) { JOM(4, "killing audio urbs\n"); m = 0; - list_for_each(plist_head, \ + list_for_each(plist_head, (peasycap->purb_audio_head)) { - pdata_urb = list_entry(plist_head, \ + pdata_urb = list_entry(plist_head, struct data_urb, list_head); if ((struct data_urb *)NULL != pdata_urb) { - if ((struct urb *)NULL != \ + if ((struct urb *)NULL != pdata_urb->purb) { usb_kill_urb(pdata_urb->purb); m++; @@ -4929,11 +4929,11 @@ switch (bInterfaceNumber) { case 0: { if (0 <= kd && DONGLE_MANY > kd) { wake_up_interruptible(&peasycap->wq_video); - JOM(4, "about to lock easycapdc60_dongle[%i].mutex_video\n", \ + JOM(4, "about to lock easycapdc60_dongle[%i].mutex_video\n", kd); - if (mutex_lock_interruptible(&easycapdc60_dongle[kd].\ + if (mutex_lock_interruptible(&easycapdc60_dongle[kd]. mutex_video)) { - SAY("ERROR: cannot lock easycapdc60_dongle[%i]." \ + SAY("ERROR: cannot lock easycapdc60_dongle[%i]." "mutex_video\n", kd); return; } @@ -4981,11 +4981,11 @@ case 0: { case 2: { if (0 <= kd && DONGLE_MANY > kd) { wake_up_interruptible(&peasycap->wq_audio); - JOM(4, "about to lock easycapdc60_dongle[%i].mutex_audio\n", \ + JOM(4, "about to lock easycapdc60_dongle[%i].mutex_audio\n", kd); - if (mutex_lock_interruptible(&easycapdc60_dongle[kd].\ + if (mutex_lock_interruptible(&easycapdc60_dongle[kd]. mutex_audio)) { - SAY("ERROR: cannot lock easycapdc60_dongle[%i]." \ + SAY("ERROR: cannot lock easycapdc60_dongle[%i]." "mutex_audio\n", kd); return; } @@ -5052,7 +5052,7 @@ if (0 <= kd && DONGLE_MANY > kd) { } JOM(4, "locked easycapdc60_dongle[%i].mutex_audio\n", kd); } -JOM(4, "intf[%i]: %i=peasycap->kref.refcount.counter\n", \ +JOM(4, "intf[%i]: %i=peasycap->kref.refcount.counter\n", bInterfaceNumber, (int)peasycap->kref.refcount.counter); kref_put(&peasycap->kref, easycap_delete); JOT(4, "intf[%i]: kref_put() done.\n", bInterfaceNumber); @@ -5073,7 +5073,7 @@ easycap_module_init(void) int k, rc; SAY("========easycap=======\n"); -JOT(4, "begins. %i=debug %i=bars %i=gain\n", easycap_debug, easycap_bars, \ +JOT(4, "begins. %i=debug %i=bars %i=gain\n", easycap_debug, easycap_bars, easycap_gain); SAY("version: " EASYCAP_DRIVER_VERSION "\n"); @@ -5123,7 +5123,7 @@ MODULE_VERSION(EASYCAP_DRIVER_VERSION); #if defined(EASYCAP_DEBUG) MODULE_PARM_DESC(debug, "Debug level: 0(default),1,2,...,9"); #endif /*EASYCAP_DEBUG*/ -MODULE_PARM_DESC(bars, \ +MODULE_PARM_DESC(bars, "Testcard bars on input signal failure: 0=>no, 1=>yes(default)"); MODULE_PARM_DESC(gain, "Audio gain: 0,...,16(default),...31"); /*****************************************************************************/ diff --git a/drivers/staging/easycap/easycap_settings.c b/drivers/staging/easycap/easycap_settings.c index 0a23e2749514..7b2dd6eeb41f 100644 --- a/drivers/staging/easycap/easycap_settings.c +++ b/drivers/staging/easycap/easycap_settings.c @@ -44,7 +44,7 @@ const struct easycap_standard easycap_standard[] = { .mask = 0x00FF & PAL_BGHIN , .v4l2_standard = { .index = PAL_BGHIN, - .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | \ + .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | V4L2_STD_PAL_I | V4L2_STD_PAL_N), .name = "PAL_BGHIN", .frameperiod = {1, 25}, @@ -165,8 +165,8 @@ const struct easycap_standard easycap_standard[] = { .mask = 0x8000 | (0x00FF & PAL_BGHIN_SLOW), .v4l2_standard = { .index = PAL_BGHIN_SLOW, - .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | \ - V4L2_STD_PAL_I | V4L2_STD_PAL_N | \ + .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | + V4L2_STD_PAL_I | V4L2_STD_PAL_N | (((v4l2_std_id)0x01) << 32)), .name = "PAL_BGHIN_SLOW", .frameperiod = {1, 5}, @@ -573,25 +573,25 @@ for (i = 0, n = 0; i < STANDARD_MANY; i++) { strcat(&easycap_format[n].name[0], &name2[0]); strcat(&easycap_format[n].name[0], &name3[0]); strcat(&easycap_format[n].name[0], &name4[0]); - easycap_format[n].mask = \ + easycap_format[n].mask = mask1 | mask2 | mask3 | mask4; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.width = width; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.height = height; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.pixelformat = pixelformat; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.field = field; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.bytesperline = bytesperline; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.sizeimage = sizeimage; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.colorspace = colorspace; - easycap_format[n].v4l2_format\ + easycap_format[n].v4l2_format .fmt.pix.priv = 0; n++; } @@ -604,7 +604,7 @@ easycap_format[n].mask = 0xFFFF; return n; } /*---------------------------------------------------------------------------*/ -struct v4l2_queryctrl easycap_control[] = \ +struct v4l2_queryctrl easycap_control[] = {{ .id = V4L2_CID_BRIGHTNESS, .type = V4L2_CTRL_TYPE_INTEGER, diff --git a/drivers/staging/easycap/easycap_sound.c b/drivers/staging/easycap/easycap_sound.c index 0507ea19004a..8d1c0620344d 100644 --- a/drivers/staging/easycap/easycap_sound.c +++ b/drivers/staging/easycap/easycap_sound.c @@ -48,7 +48,7 @@ static const struct snd_pcm_hardware alsa_hardware = { .rate_max = 48000, .channels_min = 2, .channels_max = 2, - .buffer_bytes_max = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT * \ + .buffer_bytes_max = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT * AUDIO_FRAGMENT_MANY, .period_bytes_min = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT, .period_bytes_max = PAGE_SIZE * PAGES_PER_AUDIO_FRAGMENT * 2, @@ -108,14 +108,14 @@ if (true == peasycap->microphone) { } #if defined(EASYCAP_NEEDS_CARD_CREATE) - if (0 != snd_card_create(SNDRV_DEFAULT_IDX1, "easycap_alsa", \ - THIS_MODULE, 0, \ + if (0 != snd_card_create(SNDRV_DEFAULT_IDX1, "easycap_alsa", + THIS_MODULE, 0, &psnd_card)) { SAY("ERROR: Cannot do ALSA snd_card_create()\n"); return -EFAULT; } #else - psnd_card = snd_card_new(SNDRV_DEFAULT_IDX1, "easycap_alsa", \ + psnd_card = snd_card_new(SNDRV_DEFAULT_IDX1, "easycap_alsa", THIS_MODULE, 0); if (NULL == psnd_card) { SAY("ERROR: Cannot do ALSA snd_card_new()\n"); @@ -139,7 +139,7 @@ if (true == peasycap->microphone) { return -EFAULT; } - snd_pcm_set_ops(psnd_pcm, SNDRV_PCM_STREAM_CAPTURE, \ + snd_pcm_set_ops(psnd_pcm, SNDRV_PCM_STREAM_CAPTURE, &easycap_alsa_pcm_ops); psnd_pcm->info_flags = 0; strcpy(&psnd_pcm->name[0], &psnd_card->id[0]); @@ -199,7 +199,7 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { } much = 0; if (peasycap->audio_idle) { - JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n", \ + JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n", peasycap->audio_idle, peasycap->audio_isoc_streaming); if (peasycap->audio_isoc_streaming) goto resubmit; @@ -410,12 +410,12 @@ for (i = 0; i < purb->number_of_packets; i++) { peasycap->audio_mt++; else { if (peasycap->audio_mt) { - JOM(12, "%4i empty audio urb frames\n", \ + JOM(12, "%4i empty audio urb frames\n", peasycap->audio_mt); peasycap->audio_mt = 0; } - p1 = (__u8 *)(purb->transfer_buffer + \ + p1 = (__u8 *)(purb->transfer_buffer + purb->iso_frame_desc[i].offset); /*---------------------------------------------------------------------------*/ @@ -442,39 +442,39 @@ for (i = 0; i < purb->number_of_packets; i++) { if (false == peasycap->microphone) { if (much > more) much = more; - memcpy(prt->dma_area + \ - peasycap->dma_fill, \ + memcpy(prt->dma_area + + peasycap->dma_fill, p1, much); p1 += much; more -= much; } else { #if defined(UPSAMPLE) if (much % 16) - JOM(8, "MISTAKE? much" \ + JOM(8, "MISTAKE? much" " is not divisible by 16\n"); - if (much > (16 * \ + if (much > (16 * more)) - much = 16 * \ + much = 16 * more; - p2 = (__u8 *)(prt->dma_area + \ + p2 = (__u8 *)(prt->dma_area + peasycap->dma_fill); for (j = 0; j < (much/16); j++) { newaudio = ((int) *p1) - 128; - newaudio = 128 * \ + newaudio = 128 * newaudio; - delta = (newaudio - oldaudio) \ + delta = (newaudio - oldaudio) / 4; s16 = oldaudio + delta; for (k = 0; k < 4; k++) { *p2 = (0x00FF & s16); - *(p2 + 1) = (0xFF00 & \ + *(p2 + 1) = (0xFF00 & s16) >> 8; p2 += 2; *p2 = (0x00FF & s16); - *(p2 + 1) = (0xFF00 & \ + *(p2 + 1) = (0xFF00 & s16) >> 8; p2 += 2; s16 += delta; @@ -486,15 +486,15 @@ for (i = 0; i < purb->number_of_packets; i++) { #else /*!UPSAMPLE*/ if (much > (2 * more)) much = 2 * more; - p2 = (__u8 *)(prt->dma_area + \ + p2 = (__u8 *)(prt->dma_area + peasycap->dma_fill); for (j = 0; j < (much / 2); j++) { s16 = ((int) *p1) - 128; - s16 = 128 * \ + s16 = 128 * s16; *p2 = (0x00FF & s16); - *(p2 + 1) = (0xFF00 & s16) >> \ + *(p2 + 1) = (0xFF00 & s16) >> 8; p1++; p2 += 2; more--; @@ -503,25 +503,25 @@ for (i = 0; i < purb->number_of_packets; i++) { } peasycap->dma_fill += much; if (peasycap->dma_fill >= peasycap->dma_next) { - isfragment = peasycap->dma_fill / \ + isfragment = peasycap->dma_fill / fragment_bytes; if (0 > isfragment) { - SAM("MISTAKE: isfragment is " \ + SAM("MISTAKE: isfragment is " "negative\n"); return; } - peasycap->dma_read = (isfragment \ + peasycap->dma_read = (isfragment - 1) * fragment_bytes; - peasycap->dma_next = (isfragment \ + peasycap->dma_next = (isfragment + 1) * fragment_bytes; if (dma_bytes < peasycap->dma_next) { - peasycap->dma_next = \ + peasycap->dma_next = fragment_bytes; } if (0 <= peasycap->dma_read) { - JOM(8, "snd_pcm_period_elap" \ - "sed(), %i=" \ - "isfragment\n", \ + JOM(8, "snd_pcm_period_elap" + "sed(), %i=" + "isfragment\n", isfragment); snd_pcm_period_elapsed(pss); } @@ -529,8 +529,8 @@ for (i = 0; i < purb->number_of_packets; i++) { } } } else { - JOM(12, "discarding audio samples because " \ - "%i=purb->iso_frame_desc[i].status\n", \ + JOM(12, "discarding audio samples because " + "%i=purb->iso_frame_desc[i].status\n", purb->iso_frame_desc[i].status); } @@ -549,8 +549,8 @@ if (peasycap->audio_isoc_streaming) { rc = usb_submit_urb(purb, GFP_ATOMIC); if (0 != rc) { if ((-ENODEV != rc) && (-ENOENT != rc)) { - SAM("ERROR: while %i=audio_idle, " \ - "usb_submit_urb() failed " \ + SAM("ERROR: while %i=audio_idle, " + "usb_submit_urb() failed " "with rc:\n", peasycap->audio_idle); } switch (rc) { @@ -685,7 +685,7 @@ return 0; } /*****************************************************************************/ int -easycap_alsa_hw_params(struct snd_pcm_substream *pss, \ +easycap_alsa_hw_params(struct snd_pcm_substream *pss, struct snd_pcm_hw_params *phw) { int rc; @@ -785,7 +785,7 @@ JOM(16, "ALSA decides %8i =sample_bits\n", (int)pss->runtime->sample_bits); JOM(16, "ALSA decides %8i =frame_bits\n", (int)pss->runtime->frame_bits); JOM(16, "ALSA decides %8i =min_align\n", (int)pss->runtime->min_align); JOM(12, "ALSA decides %8i =hw_ptr_base\n", (int)pss->runtime->hw_ptr_base); -JOM(12, "ALSA decides %8i =hw_ptr_interrupt\n", \ +JOM(12, "ALSA decides %8i =hw_ptr_interrupt\n", (int)pss->runtime->hw_ptr_interrupt); if (prt->dma_bytes != 4 * ((int)prt->period_size) * ((int)prt->periods)) { SAY("MISTAKE: unexpected ALSA parameters\n"); @@ -806,7 +806,7 @@ easycap_alsa_trigger(struct snd_pcm_substream *pss, int cmd) struct easycap *peasycap; int retval; -JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START, \ +JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START, SNDRV_PCM_TRIGGER_STOP); if (NULL == pss) { SAY("ERROR: pss is NULL\n"); @@ -858,8 +858,8 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { return -EFAULT; } if ((0 != peasycap->audio_eof) || (0 != peasycap->audio_idle)) { - JOM(8, "returning -EIO because " \ - "%i=audio_idle %i=audio_eof\n", \ + JOM(8, "returning -EIO because " + "%i=audio_idle %i=audio_eof\n", peasycap->audio_idle, peasycap->audio_eof); return -EIO; } @@ -870,9 +870,9 @@ if (0 > peasycap->dma_read) { } offset = ((snd_pcm_uframes_t)peasycap->dma_read)/4; JOM(8, "ALSA decides %8i =hw_ptr_base\n", (int)pss->runtime->hw_ptr_base); -JOM(8, "ALSA decides %8i =hw_ptr_interrupt\n", \ +JOM(8, "ALSA decides %8i =hw_ptr_interrupt\n", (int)pss->runtime->hw_ptr_interrupt); -JOM(8, "%7i=offset %7i=dma_read %7i=dma_next\n", \ +JOM(8, "%7i=offset %7i=dma_read %7i=dma_next\n", (int)offset, peasycap->dma_read, peasycap->dma_next); return offset; } @@ -951,14 +951,14 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { } much = 0; if (peasycap->audio_idle) { - JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n", \ + JOM(16, "%i=audio_idle %i=audio_isoc_streaming\n", peasycap->audio_idle, peasycap->audio_isoc_streaming); if (peasycap->audio_isoc_streaming) { rc = usb_submit_urb(purb, GFP_ATOMIC); if (0 != rc) { if (-ENODEV != rc && -ENOENT != rc) { - SAM("ERROR: while %i=audio_idle, " \ - "usb_submit_urb() failed with rc:\n", \ + SAM("ERROR: while %i=audio_idle, " + "usb_submit_urb() failed with rc:\n", peasycap->audio_idle); } switch (rc) { @@ -1212,12 +1212,12 @@ for (i = 0; i < purb->number_of_packets; i++) { peasycap->audio_mt++; else { if (peasycap->audio_mt) { - JOM(12, "%4i empty audio urb frames\n", \ + JOM(12, "%4i empty audio urb frames\n", peasycap->audio_mt); peasycap->audio_mt = 0; } - p1 = (__u8 *)(purb->transfer_buffer + \ + p1 = (__u8 *)(purb->transfer_buffer + purb->iso_frame_desc[i].offset); leap = 0; @@ -1234,64 +1234,64 @@ for (i = 0; i < purb->number_of_packets; i++) { SAM("MISTAKE: more is negative\n"); return; } - if (peasycap->audio_buffer_page_many <= \ + if (peasycap->audio_buffer_page_many <= peasycap->audio_fill) { - SAM("ERROR: bad " \ + SAM("ERROR: bad " "peasycap->audio_fill\n"); return; } - paudio_buffer = &peasycap->audio_buffer\ + paudio_buffer = &peasycap->audio_buffer [peasycap->audio_fill]; - if (PAGE_SIZE < (paudio_buffer->pto - \ + if (PAGE_SIZE < (paudio_buffer->pto - paudio_buffer->pgo)) { SAM("ERROR: bad paudio_buffer->pto\n"); return; } - if (PAGE_SIZE == (paudio_buffer->pto - \ + if (PAGE_SIZE == (paudio_buffer->pto - paudio_buffer->pgo)) { #if defined(TESTTONE) - easyoss_testtone(peasycap, \ + easyoss_testtone(peasycap, peasycap->audio_fill); #endif /*TESTTONE*/ - paudio_buffer->pto = \ + paudio_buffer->pto = paudio_buffer->pgo; (peasycap->audio_fill)++; - if (peasycap->\ - audio_buffer_page_many <= \ + if (peasycap-> + audio_buffer_page_many <= peasycap->audio_fill) peasycap->audio_fill = 0; - JOM(8, "bumped peasycap->" \ - "audio_fill to %i\n", \ + JOM(8, "bumped peasycap->" + "audio_fill to %i\n", peasycap->audio_fill); - paudio_buffer = &peasycap->\ - audio_buffer\ + paudio_buffer = &peasycap-> + audio_buffer [peasycap->audio_fill]; - paudio_buffer->pto = \ + paudio_buffer->pto = paudio_buffer->pgo; - if (!(peasycap->audio_fill % \ - peasycap->\ + if (!(peasycap->audio_fill % + peasycap-> audio_pages_per_fragment)) { - JOM(12, "wakeup call on wq_" \ - "audio, %i=frag reading %i" \ - "=fragment fill\n", \ - (peasycap->audio_read / \ - peasycap->\ - audio_pages_per_fragment), \ - (peasycap->audio_fill / \ - peasycap->\ + JOM(12, "wakeup call on wq_" + "audio, %i=frag reading %i" + "=fragment fill\n", + (peasycap->audio_read / + peasycap-> + audio_pages_per_fragment), + (peasycap->audio_fill / + peasycap-> audio_pages_per_fragment)); - wake_up_interruptible\ + wake_up_interruptible (&(peasycap->wq_audio)); } } - much = PAGE_SIZE - (int)(paudio_buffer->pto -\ + much = PAGE_SIZE - (int)(paudio_buffer->pto - paudio_buffer->pgo); if (false == peasycap->microphone) { @@ -1304,30 +1304,30 @@ for (i = 0; i < purb->number_of_packets; i++) { } else { #if defined(UPSAMPLE) if (much % 16) - JOM(8, "MISTAKE? much" \ + JOM(8, "MISTAKE? much" " is not divisible by 16\n"); - if (much > (16 * \ + if (much > (16 * more)) - much = 16 * \ + much = 16 * more; p2 = (__u8 *)paudio_buffer->pto; for (j = 0; j < (much/16); j++) { newaudio = ((int) *p1) - 128; - newaudio = 128 * \ + newaudio = 128 * newaudio; - delta = (newaudio - oldaudio) \ + delta = (newaudio - oldaudio) / 4; s16 = oldaudio + delta; for (k = 0; k < 4; k++) { *p2 = (0x00FF & s16); - *(p2 + 1) = (0xFF00 & \ + *(p2 + 1) = (0xFF00 & s16) >> 8; p2 += 2; *p2 = (0x00FF & s16); - *(p2 + 1) = (0xFF00 & \ + *(p2 + 1) = (0xFF00 & s16) >> 8; p2 += 2; @@ -1344,10 +1344,10 @@ for (i = 0; i < purb->number_of_packets; i++) { for (j = 0; j < (much / 2); j++) { s16 = ((int) *p1) - 128; - s16 = 128 * \ + s16 = 128 * s16; *p2 = (0x00FF & s16); - *(p2 + 1) = (0xFF00 & s16) >> \ + *(p2 + 1) = (0xFF00 & s16) >> 8; p1++; p2 += 2; more--; @@ -1358,8 +1358,8 @@ for (i = 0; i < purb->number_of_packets; i++) { } } } else { - JOM(12, "discarding audio samples because " \ - "%i=purb->iso_frame_desc[i].status\n", \ + JOM(12, "discarding audio samples because " + "%i=purb->iso_frame_desc[i].status\n", purb->iso_frame_desc[i].status); } @@ -1378,8 +1378,8 @@ if (peasycap->audio_isoc_streaming) { rc = usb_submit_urb(purb, GFP_ATOMIC); if (0 != rc) { if (-ENODEV != rc && -ENOENT != rc) { - SAM("ERROR: while %i=audio_idle, " \ - "usb_submit_urb() failed " \ + SAM("ERROR: while %i=audio_idle, " + "usb_submit_urb() failed " "with rc:\n", peasycap->audio_idle); } switch (rc) { @@ -1489,7 +1489,7 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { SAY("ERROR: pv4l2_device is NULL\n"); return -EFAULT; } - peasycap = (struct easycap *) \ + peasycap = (struct easycap *) container_of(pv4l2_device, struct easycap, v4l2_device); } #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ @@ -1537,7 +1537,7 @@ return 0; } /*****************************************************************************/ ssize_t -easyoss_read(struct file *file, char __user *puserspacebuffer, \ +easyoss_read(struct file *file, char __user *puserspacebuffer, size_t kount, loff_t *poff) { struct timeval timeval; @@ -1609,7 +1609,7 @@ if (0 <= kd && DONGLE_MANY > kd) { return -ERESTARTSYS; } if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { - SAY("ERROR: bad peasycap: 0x%08lX\n", \ + SAY("ERROR: bad peasycap: 0x%08lX\n", (unsigned long int) peasycap); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); return -ERESTARTSYS; @@ -1634,7 +1634,7 @@ if (file->f_flags & O_NONBLOCK) else JOT(8, "BLOCKING kount=%i, *poff=%i\n", (int)kount, (int)(*poff)); -if ((0 > peasycap->audio_read) || \ +if ((0 > peasycap->audio_read) || (peasycap->audio_buffer_page_many <= peasycap->audio_read)) { SAM("ERROR: peasycap->audio_read out of range\n"); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); @@ -1646,22 +1646,22 @@ if ((struct data_buffer *)NULL == pdata_buffer) { mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); return -EFAULT; } -JOM(12, "before wait, %i=frag read %i=frag fill\n", \ - (peasycap->audio_read / peasycap->audio_pages_per_fragment), \ +JOM(12, "before wait, %i=frag read %i=frag fill\n", + (peasycap->audio_read / peasycap->audio_pages_per_fragment), (peasycap->audio_fill / peasycap->audio_pages_per_fragment)); fragment = (peasycap->audio_read / peasycap->audio_pages_per_fragment); -while ((fragment == (peasycap->audio_fill / \ - peasycap->audio_pages_per_fragment)) || \ +while ((fragment == (peasycap->audio_fill / + peasycap->audio_pages_per_fragment)) || (0 == (PAGE_SIZE - (pdata_buffer->pto - pdata_buffer->pgo)))) { if (file->f_flags & O_NONBLOCK) { JOM(16, "returning -EAGAIN as instructed\n"); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); return -EAGAIN; } - rc = wait_event_interruptible(peasycap->wq_audio, \ - (peasycap->audio_idle || peasycap->audio_eof || \ - ((fragment != (peasycap->audio_fill / \ - peasycap->audio_pages_per_fragment)) && \ + rc = wait_event_interruptible(peasycap->wq_audio, + (peasycap->audio_idle || peasycap->audio_eof || + ((fragment != (peasycap->audio_fill / + peasycap->audio_pages_per_fragment)) && (0 < (PAGE_SIZE - (pdata_buffer->pto - pdata_buffer->pgo)))))); if (0 != rc) { SAM("aborted by signal\n"); @@ -1669,14 +1669,14 @@ while ((fragment == (peasycap->audio_fill / \ return -ERESTARTSYS; } if (peasycap->audio_eof) { - JOM(8, "returning 0 because %i=audio_eof\n", \ + JOM(8, "returning 0 because %i=audio_eof\n", peasycap->audio_eof); kill_audio_urbs(peasycap); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); return 0; } if (peasycap->audio_idle) { - JOM(16, "returning 0 because %i=audio_idle\n", \ + JOM(16, "returning 0 because %i=audio_idle\n", peasycap->audio_idle); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); return 0; @@ -1687,12 +1687,12 @@ while ((fragment == (peasycap->audio_fill / \ return 0; } } -JOM(12, "after wait, %i=frag read %i=frag fill\n", \ - (peasycap->audio_read / peasycap->audio_pages_per_fragment), \ +JOM(12, "after wait, %i=frag read %i=frag fill\n", + (peasycap->audio_read / peasycap->audio_pages_per_fragment), (peasycap->audio_fill / peasycap->audio_pages_per_fragment)); szret = (size_t)0; fragment = (peasycap->audio_read / peasycap->audio_pages_per_fragment); -while (fragment == (peasycap->audio_read / \ +while (fragment == (peasycap->audio_read / peasycap->audio_pages_per_fragment)) { if (NULL == pdata_buffer->pgo) { SAM("ERROR: pdata_buffer->pgo is NULL\n"); @@ -1714,15 +1714,15 @@ while (fragment == (peasycap->audio_read / \ (peasycap->audio_read)++; if (peasycap->audio_buffer_page_many <= peasycap->audio_read) peasycap->audio_read = 0; - JOM(12, "bumped peasycap->audio_read to %i\n", \ + JOM(12, "bumped peasycap->audio_read to %i\n", peasycap->audio_read); - if (fragment != (peasycap->audio_read / \ + if (fragment != (peasycap->audio_read / peasycap->audio_pages_per_fragment)) break; - if ((0 > peasycap->audio_read) || \ - (peasycap->audio_buffer_page_many <= \ + if ((0 > peasycap->audio_read) || + (peasycap->audio_buffer_page_many <= peasycap->audio_read)) { SAM("ERROR: peasycap->audio_read out of range\n"); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); @@ -1751,7 +1751,7 @@ while (fragment == (peasycap->audio_read / \ more = kount1; if (more > kount) more = kount; - JOM(12, "agreed to send %li bytes from page %i\n", \ + JOM(12, "agreed to send %li bytes from page %i\n", more, peasycap->audio_read); if (!more) break; @@ -1763,7 +1763,7 @@ while (fragment == (peasycap->audio_read / \ /*---------------------------------------------------------------------------*/ p0 = (unsigned char *)pdata_buffer->pgo; l0 = 0; lm = more/2; while (l0 < lm) { - SUMMER(p0, &peasycap->audio_sample, &peasycap->audio_niveau, \ + SUMMER(p0, &peasycap->audio_sample, &peasycap->audio_niveau, &peasycap->audio_square); l0++; p0 += 2; } /*---------------------------------------------------------------------------*/ @@ -1779,11 +1779,11 @@ while (fragment == (peasycap->audio_read / \ puserspacebuffer += more; kount -= (size_t)more; } -JOM(12, "after read, %i=frag read %i=frag fill\n", \ - (peasycap->audio_read / peasycap->audio_pages_per_fragment), \ +JOM(12, "after read, %i=frag read %i=frag fill\n", + (peasycap->audio_read / peasycap->audio_pages_per_fragment), (peasycap->audio_fill / peasycap->audio_pages_per_fragment)); if (kount < 0) { - SAM("MISTAKE: %li=kount %li=szret\n", \ + SAM("MISTAKE: %li=kount %li=szret\n", (long int)kount, (long int)szret); } /*---------------------------------------------------------------------------*/ @@ -1799,7 +1799,7 @@ if (peasycap->audio_sample) { mean = peasycap->audio_niveau; sdr = signed_div(mean, peasycap->audio_sample); - JOM(8, "%8lli=mean %8lli=meansquare after %lli samples, =>\n", \ + JOM(8, "%8lli=mean %8lli=meansquare after %lli samples, =>\n", sdr.quotient, above, peasycap->audio_sample); sdr = signed_div(above, 32768); @@ -1818,9 +1818,9 @@ if (!peasycap->timeval1.tv_sec) { sdr.quotient = 192000; } else { peasycap->audio_bytes += (long long int) szret; - below = ((long long int)(1000000)) * \ - ((long long int)(timeval.tv_sec - \ - peasycap->timeval3.tv_sec)) + \ + below = ((long long int)(1000000)) * + ((long long int)(timeval.tv_sec - + peasycap->timeval3.tv_sec)) + (long long int)(timeval.tv_usec - peasycap->timeval3.tv_usec); above = 1000000 * ((long long int) peasycap->audio_bytes); @@ -1881,9 +1881,9 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) { SAM("ERROR: peasycap->pusb_device has become NULL\n"); return -ENODEV; } -rc = usb_set_interface(peasycap->pusb_device, peasycap->audio_interface, \ +rc = usb_set_interface(peasycap->pusb_device, peasycap->audio_interface, peasycap->audio_altsetting_on); -JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface, \ +JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface, peasycap->audio_altsetting_on, rc); rc = wakeup_device(peasycap->pusb_device); @@ -1930,10 +1930,10 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) { if (!peasycap->audio_isoc_streaming) { JOM(4, "initial submission of all audio urbs\n"); rc = usb_set_interface(peasycap->pusb_device, - peasycap->audio_interface, \ + peasycap->audio_interface, peasycap->audio_altsetting_on); - JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", \ - peasycap->audio_interface, \ + JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", + peasycap->audio_interface, peasycap->audio_altsetting_on, rc); isbad = 0; nospc = 0; m = 0; @@ -1946,13 +1946,13 @@ if (!peasycap->audio_isoc_streaming) { purb->interval = 1; purb->dev = peasycap->pusb_device; - purb->pipe = \ - usb_rcvisocpipe(peasycap->pusb_device,\ + purb->pipe = + usb_rcvisocpipe(peasycap->pusb_device, peasycap->audio_endpointnumber); purb->transfer_flags = URB_ISO_ASAP; - purb->transfer_buffer = \ + purb->transfer_buffer = peasycap->audio_isoc_buffer[isbuf].pgo; - purb->transfer_buffer_length = \ + purb->transfer_buffer_length = peasycap->audio_isoc_buffer_size; #if defined(EASYCAP_NEEDS_ALSA) purb->complete = easycap_alsa_complete; @@ -1961,23 +1961,23 @@ if (!peasycap->audio_isoc_streaming) { #endif /*EASYCAP_NEEDS_ALSA*/ purb->context = peasycap; purb->start_frame = 0; - purb->number_of_packets = \ + purb->number_of_packets = peasycap->audio_isoc_framesperdesc; - for (j = 0; j < peasycap->\ - audio_isoc_framesperdesc; \ + for (j = 0; j < peasycap-> + audio_isoc_framesperdesc; j++) { - purb->iso_frame_desc[j].offset = j * \ - peasycap->\ + purb->iso_frame_desc[j].offset = j * + peasycap-> audio_isoc_maxframesize; - purb->iso_frame_desc[j].length = \ - peasycap->\ + purb->iso_frame_desc[j].length = + peasycap-> audio_isoc_maxframesize; } rc = usb_submit_urb(purb, GFP_KERNEL); if (0 != rc) { isbad++; - SAM("ERROR: usb_submit_urb() failed" \ + SAM("ERROR: usb_submit_urb() failed" " for urb with rc:\n"); switch (rc) { case -ENODEV: { @@ -2047,7 +2047,7 @@ if (!peasycap->audio_isoc_streaming) { if (isbad) { JOM(4, "attempting cleanup instead of submitting\n"); list_for_each(plist_head, (peasycap->purb_audio_head)) { - pdata_urb = list_entry(plist_head, struct data_urb, \ + pdata_urb = list_entry(plist_head, struct data_urb, list_head); if (NULL != pdata_urb) { purb = pdata_urb->purb; @@ -2103,7 +2103,7 @@ if (peasycap->audio_isoc_streaming) { return -EFAULT; } } else { - JOM(8, "%i=audio_isoc_streaming, no audio urbs killed\n", \ + JOM(8, "%i=audio_isoc_streaming, no audio urbs killed\n", peasycap->audio_isoc_streaming); } return 0;