Re: [PATCH] media: usbvision: fixed coding style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dhiraj,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on staging/staging-testing soc/for-next v5.8-rc7 next-20200728]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Dhiraj-Sharma/media-usbvision-fixed-coding-style/20200728-223404
base:   git://linuxtv.org/media_tree.git master
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/staging/media/usbvision/usbvision-video.c:157:56: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     157 | static DEVICE_ATTR_RO(version, 0444, version_show, NULL);
         |                                                        ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
>> drivers/staging/media/usbvision/usbvision-video.c:157:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     157 | static DEVICE_ATTR_RO(version, 0444, version_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:168:52: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     168 | static DEVICE_ATTR_RO(model, 0444, model_show, NULL);
         |                                                    ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:168:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     168 | static DEVICE_ATTR_RO(model, 0444, model_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:180:48: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     180 | static DEVICE_ATTR_RO(hue, 0444, hue_show, NULL);
         |                                                ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:180:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     180 | static DEVICE_ATTR_RO(hue, 0444, hue_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:192:58: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     192 | static DEVICE_ATTR_RO(contrast, 0444, contrast_show, NULL);
         |                                                          ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:192:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     192 | static DEVICE_ATTR_RO(contrast, 0444, contrast_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:204:62: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     204 | static DEVICE_ATTR_RO(brightness, 0444, brightness_show, NULL);
         |                                                              ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:204:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     204 | static DEVICE_ATTR_RO(brightness, 0444, brightness_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:216:62: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     216 | static DEVICE_ATTR_RO(saturation, 0444, saturation_show, NULL);
         |                                                              ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:216:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     216 | static DEVICE_ATTR_RO(saturation, 0444, saturation_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:227:60: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     227 | static DEVICE_ATTR_RO(streaming, 0444, streaming_show, NULL);
         |                                                            ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:227:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     227 | static DEVICE_ATTR_RO(streaming, 0444, streaming_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:238:64: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     238 | static DEVICE_ATTR_RO(compression, 0444, compression_show, NULL);
         |                                                                ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:238:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     238 | static DEVICE_ATTR_RO(compression, 0444, compression_show, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:248:61: error: macro "DEVICE_ATTR_RO" passed 4 arguments, but takes just 1
     248 | static DEVICE_ATTR_RO(bridge, 0444, show_device_bridge, NULL);
         |                                                             ^
   In file included from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/staging/media/usbvision/usbvision-video.c:43:
   include/linux/device.h:131: note: macro "DEVICE_ATTR_RO" defined here
     131 | #define DEVICE_ATTR_RO(_name) \
         | 
   drivers/staging/media/usbvision/usbvision-video.c:248:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_RO' [-Werror=implicit-int]
     248 | static DEVICE_ATTR_RO(bridge, 0444, show_device_bridge, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c: In function 'usbvision_create_sysfs':
>> drivers/staging/media/usbvision/usbvision-video.c:257:41: error: 'dev_attr_version' undeclared (first use in this function)
     257 |   res = device_create_file(&vdev->dev, &dev_attr_version);
         |                                         ^~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:257:41: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/staging/media/usbvision/usbvision-video.c:260:41: error: 'dev_attr_model' undeclared (first use in this function); did you mean 'dev_to_node'?
     260 |   res = device_create_file(&vdev->dev, &dev_attr_model);
         |                                         ^~~~~~~~~~~~~~
         |                                         dev_to_node
>> drivers/staging/media/usbvision/usbvision-video.c:263:41: error: 'dev_attr_hue' undeclared (first use in this function)
     263 |   res = device_create_file(&vdev->dev, &dev_attr_hue);
         |                                         ^~~~~~~~~~~~
>> drivers/staging/media/usbvision/usbvision-video.c:266:41: error: 'dev_attr_contrast' undeclared (first use in this function)
     266 |   res = device_create_file(&vdev->dev, &dev_attr_contrast);
         |                                         ^~~~~~~~~~~~~~~~~
>> drivers/staging/media/usbvision/usbvision-video.c:269:41: error: 'dev_attr_brightness' undeclared (first use in this function)
     269 |   res = device_create_file(&vdev->dev, &dev_attr_brightness);
         |                                         ^~~~~~~~~~~~~~~~~~~
>> drivers/staging/media/usbvision/usbvision-video.c:272:41: error: 'dev_attr_saturation' undeclared (first use in this function)
     272 |   res = device_create_file(&vdev->dev, &dev_attr_saturation);
         |                                         ^~~~~~~~~~~~~~~~~~~
>> drivers/staging/media/usbvision/usbvision-video.c:275:41: error: 'dev_attr_streaming' undeclared (first use in this function)
     275 |   res = device_create_file(&vdev->dev, &dev_attr_streaming);
         |                                         ^~~~~~~~~~~~~~~~~~
>> drivers/staging/media/usbvision/usbvision-video.c:278:41: error: 'dev_attr_compression' undeclared (first use in this function)
     278 |   res = device_create_file(&vdev->dev, &dev_attr_compression);
         |                                         ^~~~~~~~~~~~~~~~~~~~
>> drivers/staging/media/usbvision/usbvision-video.c:281:41: error: 'dev_attr_bridge' undeclared (first use in this function)
     281 |   res = device_create_file(&vdev->dev, &dev_attr_bridge);
         |                                         ^~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c: In function 'usbvision_remove_sysfs':
   drivers/staging/media/usbvision/usbvision-video.c:292:35: error: 'dev_attr_version' undeclared (first use in this function)
     292 |   device_remove_file(&vdev->dev, &dev_attr_version);
         |                                   ^~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:293:35: error: 'dev_attr_model' undeclared (first use in this function); did you mean 'dev_to_node'?
     293 |   device_remove_file(&vdev->dev, &dev_attr_model);
         |                                   ^~~~~~~~~~~~~~
         |                                   dev_to_node
   drivers/staging/media/usbvision/usbvision-video.c:294:35: error: 'dev_attr_hue' undeclared (first use in this function)
     294 |   device_remove_file(&vdev->dev, &dev_attr_hue);
         |                                   ^~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:295:35: error: 'dev_attr_contrast' undeclared (first use in this function)
     295 |   device_remove_file(&vdev->dev, &dev_attr_contrast);
         |                                   ^~~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:296:35: error: 'dev_attr_brightness' undeclared (first use in this function)
     296 |   device_remove_file(&vdev->dev, &dev_attr_brightness);
         |                                   ^~~~~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:297:35: error: 'dev_attr_saturation' undeclared (first use in this function)
     297 |   device_remove_file(&vdev->dev, &dev_attr_saturation);
         |                                   ^~~~~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:298:35: error: 'dev_attr_streaming' undeclared (first use in this function)
     298 |   device_remove_file(&vdev->dev, &dev_attr_streaming);
         |                                   ^~~~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:299:35: error: 'dev_attr_compression' undeclared (first use in this function)
     299 |   device_remove_file(&vdev->dev, &dev_attr_compression);
         |                                   ^~~~~~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:300:35: error: 'dev_attr_bridge' undeclared (first use in this function)
     300 |   device_remove_file(&vdev->dev, &dev_attr_bridge);
         |                                   ^~~~~~~~~~~~~~~
   At top level:
   drivers/staging/media/usbvision/usbvision-video.c:240:16: warning: 'show_device_bridge' defined but not used [-Wunused-function]
     240 | static ssize_t show_device_bridge(struct device *cd,
         |                ^~~~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:229:16: warning: 'compression_show' defined but not used [-Wunused-function]
     229 | static ssize_t compression_show(struct device *cd,
         |                ^~~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:218:16: warning: 'streaming_show' defined but not used [-Wunused-function]
     218 | static ssize_t streaming_show(struct device *cd,
         |                ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:206:16: warning: 'saturation_show' defined but not used [-Wunused-function]
     206 | static ssize_t saturation_show(struct device *cd,
         |                ^~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:194:16: warning: 'brightness_show' defined but not used [-Wunused-function]
     194 | static ssize_t brightness_show(struct device *cd,
         |                ^~~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:182:16: warning: 'contrast_show' defined but not used [-Wunused-function]
     182 | static ssize_t contrast_show(struct device *cd,
         |                ^~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:170:16: warning: 'hue_show' defined but not used [-Wunused-function]
     170 | static ssize_t hue_show(struct device *cd,
         |                ^~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:159:16: warning: 'model_show' defined but not used [-Wunused-function]
     159 | static ssize_t model_show(struct device *cd,
         |                ^~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:248:8: warning: 'DEVICE_ATTR_RO' defined but not used [-Wunused-variable]
     248 | static DEVICE_ATTR_RO(bridge, 0444, show_device_bridge, NULL);
         |        ^~~~~~~~~~~~~~
   drivers/staging/media/usbvision/usbvision-video.c:152:16: warning: 'version_show' defined but not used [-Wunused-function]
     152 | static ssize_t version_show(struct device *cd,
         |                ^~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/DEVICE_ATTR_RO +157 drivers/staging/media/usbvision/usbvision-video.c

   151	
   152	static ssize_t version_show(struct device *cd,
   153				    struct device_attribute *attr, char *buf)
   154	{
   155		return sprintf(buf, "%s\n", USBVISION_VERSION_STRING);
   156	}
 > 157	static DEVICE_ATTR_RO(version, 0444, version_show, NULL);
   158	
   159	static ssize_t model_show(struct device *cd,
   160				  struct device_attribute *attr, char *buf)
   161	{
   162		struct video_device *vdev = to_video_device(cd);
   163		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   164	
   165		return sprintf(buf, "%s\n",
   166			       usbvision_device_data[usbvision->dev_model].model_string);
   167	}
   168	static DEVICE_ATTR_RO(model, 0444, model_show, NULL);
   169	
   170	static ssize_t hue_show(struct device *cd,
   171				struct device_attribute *attr, char *buf)
   172	{
   173		struct video_device *vdev = to_video_device(cd);
   174		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   175		s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
   176							  V4L2_CID_HUE));
   177	
   178		return sprintf(buf, "%d\n", val);
   179	}
   180	static DEVICE_ATTR_RO(hue, 0444, hue_show, NULL);
   181	
   182	static ssize_t contrast_show(struct device *cd,
   183				     struct device_attribute *attr, char *buf)
   184	{
   185		struct video_device *vdev = to_video_device(cd);
   186		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   187		s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
   188							  V4L2_CID_CONTRAST));
   189	
   190		return sprintf(buf, "%d\n", val);
   191	}
   192	static DEVICE_ATTR_RO(contrast, 0444, contrast_show, NULL);
   193	
   194	static ssize_t brightness_show(struct device *cd,
   195				       struct device_attribute *attr, char *buf)
   196	{
   197		struct video_device *vdev = to_video_device(cd);
   198		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   199		s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
   200							  V4L2_CID_BRIGHTNESS));
   201	
   202		return sprintf(buf, "%d\n", val);
   203	}
   204	static DEVICE_ATTR_RO(brightness, 0444, brightness_show, NULL);
   205	
   206	static ssize_t saturation_show(struct device *cd,
   207				       struct device_attribute *attr, char *buf)
   208	{
   209		struct video_device *vdev = to_video_device(cd);
   210		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   211		s32 val = v4l2_ctrl_g_ctrl(v4l2_ctrl_find(&usbvision->hdl,
   212							  V4L2_CID_SATURATION));
   213	
   214		return sprintf(buf, "%d\n", val);
   215	}
   216	static DEVICE_ATTR_RO(saturation, 0444, saturation_show, NULL);
   217	
   218	static ssize_t streaming_show(struct device *cd,
   219				      struct device_attribute *attr, char *buf)
   220	{
   221		struct video_device *vdev = to_video_device(cd);
   222		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   223	
   224		return sprintf(buf, "%s\n",
   225			       YES_NO(usbvision->streaming == stream_on ? 1 : 0));
   226	}
   227	static DEVICE_ATTR_RO(streaming, 0444, streaming_show, NULL);
   228	
   229	static ssize_t compression_show(struct device *cd,
   230					struct device_attribute *attr, char *buf)
   231	{
   232		struct video_device *vdev = to_video_device(cd);
   233		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   234	
   235		return sprintf(buf, "%s\n",
   236			       YES_NO(usbvision->isoc_mode == ISOC_MODE_COMPRESS));
   237	}
   238	static DEVICE_ATTR_RO(compression, 0444, compression_show, NULL);
   239	
   240	static ssize_t show_device_bridge(struct device *cd,
   241					  struct device_attribute *attr, char *buf)
   242	{
   243		struct video_device *vdev = to_video_device(cd);
   244		struct usb_usbvision *usbvision = video_get_drvdata(vdev);
   245	
   246		return sprintf(buf, "%d\n", usbvision->bridge_type);
   247	}
   248	static DEVICE_ATTR_RO(bridge, 0444, show_device_bridge, NULL);
   249	
   250	static void usbvision_create_sysfs(struct video_device *vdev)
   251	{
   252		int res;
   253	
   254		if (!vdev)
   255			return;
   256		do {
 > 257			res = device_create_file(&vdev->dev, &dev_attr_version);
   258			if (res < 0)
   259				break;
 > 260			res = device_create_file(&vdev->dev, &dev_attr_model);
   261			if (res < 0)
   262				break;
 > 263			res = device_create_file(&vdev->dev, &dev_attr_hue);
   264			if (res < 0)
   265				break;
 > 266			res = device_create_file(&vdev->dev, &dev_attr_contrast);
   267			if (res < 0)
   268				break;
 > 269			res = device_create_file(&vdev->dev, &dev_attr_brightness);
   270			if (res < 0)
   271				break;
 > 272			res = device_create_file(&vdev->dev, &dev_attr_saturation);
   273			if (res < 0)
   274				break;
 > 275			res = device_create_file(&vdev->dev, &dev_attr_streaming);
   276			if (res < 0)
   277				break;
 > 278			res = device_create_file(&vdev->dev, &dev_attr_compression);
   279			if (res < 0)
   280				break;
 > 281			res = device_create_file(&vdev->dev, &dev_attr_bridge);
   282			if (res >= 0)
   283				return;
   284		} while (0);
   285	
   286		dev_err(&vdev->dev, "%s error: %d\n", __func__, res);
   287	}
   288	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux