linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: delete redundant printing of return value
@ 2021-03-11 12:13 Wang Qing
  0 siblings, 0 replies; 6+ messages in thread
From: Wang Qing @ 2021-03-11 12:13 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Jason Yan, Sam Ravnborg, Wang Qing,
	dri-devel, linux-fbdev, linux-kernel

platform_get_irq() has already checked and printed the return value, 
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/video/fbdev/pxa168fb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c
index 47e6a1d..e4fe6a4
--- a/drivers/video/fbdev/pxa168fb.c
+++ b/drivers/video/fbdev/pxa168fb.c
@@ -618,10 +618,8 @@ static int pxa168fb_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no IRQ defined\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
 	if (info == NULL) {
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] video: fbdev: delete redundant printing of return value
  2021-03-11 12:14 Wang Qing
@ 2021-03-11 16:29 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-03-11 16:29 UTC (permalink / raw)
  To: Wang Qing, Bartlomiej Zolnierkiewicz, Gustavo A. R. Silva,
	Tiezhu Yang, Sam Ravnborg, Christophe JAILLET, dri-devel,
	linux-fbdev, linux-kernel
  Cc: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6292 bytes --]

Hi Wang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.12-rc2 next-20210311]
[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/Wang-Qing/video-fbdev-delete-redundant-printing-of-return-value/20210311-201743
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a74e6a014c9d4d4161061f770c9b4f98372ac778
config: arm-pxa_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/6d93756a48a2f91e8ac0cfdfd8734d30080706c2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Wang-Qing/video-fbdev-delete-redundant-printing-of-return-value/20210311-201743
        git checkout 6d93756a48a2f91e8ac0cfdfd8734d30080706c2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

   drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
>> drivers/video/fbdev/pxafb.c:2329:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    2329 |  if (irq < 0)
         |  ^~
   drivers/video/fbdev/pxafb.c:2331:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    2331 |   goto failed_free_mem;
         |   ^~~~


vim +/if +2329 drivers/video/fbdev/pxafb.c

  2235	
  2236	static int pxafb_probe(struct platform_device *dev)
  2237	{
  2238		struct pxafb_info *fbi;
  2239		struct pxafb_mach_info *inf, *pdata;
  2240		int i, irq, ret;
  2241	
  2242		dev_dbg(&dev->dev, "pxafb_probe\n");
  2243	
  2244		ret = -ENOMEM;
  2245		pdata = dev_get_platdata(&dev->dev);
  2246		inf = devm_kmalloc(&dev->dev, sizeof(*inf), GFP_KERNEL);
  2247		if (!inf)
  2248			goto failed;
  2249	
  2250		if (pdata) {
  2251			*inf = *pdata;
  2252			inf->modes =
  2253				devm_kmalloc_array(&dev->dev, pdata->num_modes,
  2254						   sizeof(inf->modes[0]), GFP_KERNEL);
  2255			if (!inf->modes)
  2256				goto failed;
  2257			for (i = 0; i < inf->num_modes; i++)
  2258				inf->modes[i] = pdata->modes[i];
  2259		}
  2260	
  2261		if (!pdata)
  2262			inf = of_pxafb_of_mach_info(&dev->dev);
  2263		if (IS_ERR_OR_NULL(inf))
  2264			goto failed;
  2265	
  2266		ret = pxafb_parse_options(&dev->dev, g_options, inf);
  2267		if (ret < 0)
  2268			goto failed;
  2269	
  2270		pxafb_check_options(&dev->dev, inf);
  2271	
  2272		dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
  2273				inf->modes->xres,
  2274				inf->modes->yres,
  2275				inf->modes->bpp);
  2276		if (inf->modes->xres == 0 ||
  2277		    inf->modes->yres == 0 ||
  2278		    inf->modes->bpp == 0) {
  2279			dev_err(&dev->dev, "Invalid resolution or bit depth\n");
  2280			ret = -EINVAL;
  2281			goto failed;
  2282		}
  2283	
  2284		fbi = pxafb_init_fbinfo(&dev->dev, inf);
  2285		if (IS_ERR(fbi)) {
  2286			dev_err(&dev->dev, "Failed to initialize framebuffer device\n");
  2287			ret = PTR_ERR(fbi);
  2288			goto failed;
  2289		}
  2290	
  2291		if (cpu_is_pxa3xx() && inf->acceleration_enabled)
  2292			fbi->fb.fix.accel = FB_ACCEL_PXA3XX;
  2293	
  2294		fbi->backlight_power = inf->pxafb_backlight_power;
  2295		fbi->lcd_power = inf->pxafb_lcd_power;
  2296	
  2297		fbi->lcd_supply = devm_regulator_get_optional(&dev->dev, "lcd");
  2298		if (IS_ERR(fbi->lcd_supply)) {
  2299			if (PTR_ERR(fbi->lcd_supply) == -EPROBE_DEFER)
  2300				return -EPROBE_DEFER;
  2301	
  2302			fbi->lcd_supply = NULL;
  2303		}
  2304	
  2305		fbi->mmio_base = devm_platform_ioremap_resource(dev, 0);
  2306		if (IS_ERR(fbi->mmio_base)) {
  2307			dev_err(&dev->dev, "failed to get I/O memory\n");
  2308			ret = PTR_ERR(fbi->mmio_base);
  2309			goto failed;
  2310		}
  2311	
  2312		fbi->dma_buff_size = PAGE_ALIGN(sizeof(struct pxafb_dma_buff));
  2313		fbi->dma_buff = dma_alloc_coherent(fbi->dev, fbi->dma_buff_size,
  2314					&fbi->dma_buff_phys, GFP_KERNEL);
  2315		if (fbi->dma_buff == NULL) {
  2316			dev_err(&dev->dev, "failed to allocate memory for DMA\n");
  2317			ret = -ENOMEM;
  2318			goto failed;
  2319		}
  2320	
  2321		ret = pxafb_init_video_memory(fbi);
  2322		if (ret) {
  2323			dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
  2324			ret = -ENOMEM;
  2325			goto failed_free_dma;
  2326		}
  2327	
  2328		irq = platform_get_irq(dev, 0);
> 2329		if (irq < 0)
  2330			ret = -ENODEV;
  2331			goto failed_free_mem;
  2332	
  2333		ret = devm_request_irq(&dev->dev, irq, pxafb_handle_irq, 0, "LCD", fbi);
  2334		if (ret) {
  2335			dev_err(&dev->dev, "request_irq failed: %d\n", ret);
  2336			ret = -EBUSY;
  2337			goto failed_free_mem;
  2338		}
  2339	
  2340		ret = pxafb_smart_init(fbi);
  2341		if (ret) {
  2342			dev_err(&dev->dev, "failed to initialize smartpanel\n");
  2343			goto failed_free_mem;
  2344		}
  2345	
  2346		/*
  2347		 * This makes sure that our colour bitfield
  2348		 * descriptors are correctly initialised.
  2349		 */
  2350		ret = pxafb_check_var(&fbi->fb.var, &fbi->fb);
  2351		if (ret) {
  2352			dev_err(&dev->dev, "failed to get suitable mode\n");
  2353			goto failed_free_mem;
  2354		}
  2355	
  2356		ret = pxafb_set_par(&fbi->fb);
  2357		if (ret) {
  2358			dev_err(&dev->dev, "Failed to set parameters\n");
  2359			goto failed_free_mem;
  2360		}
  2361	
  2362		platform_set_drvdata(dev, fbi);
  2363	
  2364		ret = register_framebuffer(&fbi->fb);
  2365		if (ret < 0) {
  2366			dev_err(&dev->dev,
  2367				"Failed to register framebuffer device: %d\n", ret);
  2368			goto failed_free_cmap;
  2369		}
  2370	
  2371		pxafb_overlay_init(fbi);
  2372	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34585 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] video: fbdev: delete redundant printing of return value
@ 2021-03-11 12:14 Wang Qing
  0 siblings, 0 replies; 6+ messages in thread
From: Wang Qing @ 2021-03-11 12:14 UTC (permalink / raw)
  To: Tony Prisk, linux-arm-kernel, dri-devel, linux-fbdev, linux-kernel
  Cc: Wang Qing

platform_get_irq() has already checked and printed the return value, 
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/video/fbdev/vt8500lcdfb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c
index c614762..4cacff6
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -373,7 +373,6 @@ static int vt8500lcd_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "no IRQ defined\n");
 		ret = -ENODEV;
 		goto failed_free_palette;
 	}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] video: fbdev: delete redundant printing of return value
@ 2021-03-11 12:14 Wang Qing
  0 siblings, 0 replies; 6+ messages in thread
From: Wang Qing @ 2021-03-11 12:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, dri-devel, linux-fbdev, linux-arm-kernel,
	linux-samsung-soc, linux-kernel
  Cc: Wang Qing

platform_get_irq() has already checked and printed the return value, 
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/video/fbdev/s3c2410fb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/s3c2410fb.c b/drivers/video/fbdev/s3c2410fb.c
index d8ae525..72dd092
--- a/drivers/video/fbdev/s3c2410fb.c
+++ b/drivers/video/fbdev/s3c2410fb.c
@@ -847,10 +847,8 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
 	display = mach_info->displays + mach_info->default_display;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for device\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), &pdev->dev);
 	if (!fbinfo)
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] video: fbdev: delete redundant printing of return value
@ 2021-03-11 12:14 Wang Qing
  2021-03-11 16:29 ` kernel test robot
  0 siblings, 1 reply; 6+ messages in thread
From: Wang Qing @ 2021-03-11 12:14 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Gustavo A. R. Silva, Tiezhu Yang,
	Wang Qing, Sam Ravnborg, Christophe JAILLET, dri-devel,
	linux-fbdev, linux-kernel

platform_get_irq() has already checked and printed the return value, 
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/video/fbdev/pxafb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index f1551e0..780ac1f
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2326,11 +2326,9 @@ static int pxafb_probe(struct platform_device *dev)
 	}
 
 	irq = platform_get_irq(dev, 0);
-	if (irq < 0) {
-		dev_err(&dev->dev, "no IRQ defined\n");
+	if (irq < 0)
 		ret = -ENODEV;
 		goto failed_free_mem;
-	}
 
 	ret = devm_request_irq(&dev->dev, irq, pxafb_handle_irq, 0, "LCD", fbi);
 	if (ret) {
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] video: fbdev: delete redundant printing of return value
@ 2021-03-11 12:13 Wang Qing
  0 siblings, 0 replies; 6+ messages in thread
From: Wang Qing @ 2021-03-11 12:13 UTC (permalink / raw)
  To: Wang Qing, Arnd Bergmann, Herbert Xu, Greg Kroah-Hartman,
	Miguel Ojeda, Zhenzhong Duan, dri-devel, linux-fbdev,
	linux-kernel

platform_get_irq() has already checked and printed the return value, 
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/video/fbdev/pxa3xx-gcu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 4279e13..9d2aed7
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -613,10 +613,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 
 	/* request the IRQ */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "no IRQ defined: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,
 			       0, DRV_NAME, priv);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-11 16:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 12:13 [PATCH] video: fbdev: delete redundant printing of return value Wang Qing
2021-03-11 12:13 Wang Qing
2021-03-11 12:14 Wang Qing
2021-03-11 16:29 ` kernel test robot
2021-03-11 12:14 Wang Qing
2021-03-11 12:14 Wang Qing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).