video: fbdev: delete redundant printing of return value

Started by Wang Qing on Mar 11, 2021 · 2 messages from 2 authors · Last reply Mar 11, 2021

Subsystems (2)

Maintainers (2)

STALE2070d

open the first message on its own page

Message details and related content
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 <redacted>
---
 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
Message details and related content
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 <redacted>

All warnings (new ones prefixed by >>):

   drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
quoted
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	

63 more lines

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		}

7 more lines

Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help