diff mbox series

[v1,07/13] fbdev: pxafb: use devm_kmemdup_array()

Message ID 20250221165333.2780888-8-raag.jadav@intel.com
State Accepted
Commit b347f4571e9f3d5b0ea719aeec1af4d500c1507f
Headers show
Series Convert to use devm_kmemdup_array() | expand

Commit Message

Raag Jadav Feb. 21, 2025, 4:53 p.m. UTC
Convert to use devm_kmemdup() and devm_kmemdup_array() which are
more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/video/fbdev/pxafb.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

Comments

kernel test robot Feb. 21, 2025, 9:41 p.m. UTC | #1
Hi Raag,

kernel test robot noticed the following build warnings:

[auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]

url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
base:   b16e9f8547a328b19af59afc213ce323124d11e9
patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
>> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
    2236 |         int i, irq, ret;
         |             ^


vim +/i +2236 drivers/video/fbdev/pxafb.c

420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2231  
48c68c4f1b5424 drivers/video/pxafb.c       Greg Kroah-Hartman 2012-12-21  2232  static int pxafb_probe(struct platform_device *dev)
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2233  {
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2234  	struct pxafb_info *fbi;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2235  	struct pxafb_mach_info *inf, *pdata;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12 @2236  	int i, irq, ret;
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2237  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2238  	dev_dbg(&dev->dev, "pxafb_probe\n");
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2239  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2240  	ret = -ENOMEM;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2241  	pdata = dev_get_platdata(&dev->dev);
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2242  	if (pdata) {
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2243  		inf = devm_kmemdup(&dev->dev, pdata, sizeof(*pdata), GFP_KERNEL);
6f6abd360603af drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-19  2244  		if (!inf)
6f6abd360603af drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-19  2245  			goto failed;
420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2246  
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2247  		inf->modes = devm_kmemdup_array(&dev->dev, pdata->modes, pdata->num_modes,
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2248  						sizeof(*pdata->modes), GFP_KERNEL);
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2249  		if (!inf->modes)
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2250  			goto failed;
b23e868d35d572 drivers/video/fbdev/pxafb.c Wang Qing          2022-03-29  2251  	} else {
b23e868d35d572 drivers/video/fbdev/pxafb.c Wang Qing          2022-03-29  2252  		inf = of_pxafb_of_mach_info(&dev->dev);
420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2253  		if (IS_ERR_OR_NULL(inf))
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2254  			goto failed;
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2255  	}
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2256  
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2257  	ret = pxafb_parse_options(&dev->dev, g_options, inf);
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2258  	if (ret < 0)
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2259  		goto failed;
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2260  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2261  	pxafb_check_options(&dev->dev, inf);
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2262  
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2263  	dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2264  			inf->modes->xres,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2265  			inf->modes->yres,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2266  			inf->modes->bpp);
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2267  	if (inf->modes->xres == 0 ||
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2268  	    inf->modes->yres == 0 ||
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2269  	    inf->modes->bpp == 0) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2270  		dev_err(&dev->dev, "Invalid resolution or bit depth\n");
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2271  		ret = -EINVAL;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2272  		goto failed;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2273  	}
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2274  
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2275  	fbi = pxafb_init_fbinfo(&dev->dev, inf);
a2f2058e3d295f drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2276  	if (IS_ERR(fbi)) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2277  		dev_err(&dev->dev, "Failed to initialize framebuffer device\n");
a2f2058e3d295f drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2278  		ret = PTR_ERR(fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2279  		goto failed;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2280  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2281  
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2282  	if (cpu_is_pxa3xx() && inf->acceleration_enabled)
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2283  		fbi->fb.fix.accel = FB_ACCEL_PXA3XX;
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2284  
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2285  	fbi->backlight_power = inf->pxafb_backlight_power;
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2286  	fbi->lcd_power = inf->pxafb_lcd_power;
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2287  
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2288  	fbi->lcd_supply = devm_regulator_get_optional(&dev->dev, "lcd");
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2289  	if (IS_ERR(fbi->lcd_supply)) {
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2290  		if (PTR_ERR(fbi->lcd_supply) == -EPROBE_DEFER)
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2291  			return -EPROBE_DEFER;
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2292  
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2293  		fbi->lcd_supply = NULL;
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2294  	}
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2295  
7610bca71ea85d drivers/video/fbdev/pxafb.c Markus Elfring     2019-09-19  2296  	fbi->mmio_base = devm_platform_ioremap_resource(dev, 0);
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2297  	if (IS_ERR(fbi->mmio_base)) {
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2298  		dev_err(&dev->dev, "failed to get I/O memory\n");
f35b1d6c21b414 drivers/video/fbdev/pxafb.c Tiezhu Yang        2020-05-25  2299  		ret = PTR_ERR(fbi->mmio_base);
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2300  		goto failed;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2301  	}
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2302  
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2303  	fbi->dma_buff_size = PAGE_ALIGN(sizeof(struct pxafb_dma_buff));
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2304  	fbi->dma_buff = dma_alloc_coherent(fbi->dev, fbi->dma_buff_size,
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2305  				&fbi->dma_buff_phys, GFP_KERNEL);
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2306  	if (fbi->dma_buff == NULL) {
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2307  		dev_err(&dev->dev, "failed to allocate memory for DMA\n");
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2308  		ret = -ENOMEM;
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2309  		goto failed;
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2310  	}
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2311  
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2312  	ret = pxafb_init_video_memory(fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2313  	if (ret) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2314  		dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2315  		ret = -ENOMEM;
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2316  		goto failed_free_dma;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2317  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2318  
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2319  	irq = platform_get_irq(dev, 0);
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2320  	if (irq < 0) {
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2321  		ret = -ENODEV;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2322  		goto failed_free_mem;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2323  	}
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2324  
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2325  	ret = devm_request_irq(&dev->dev, irq, pxafb_handle_irq, 0, "LCD", fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2326  	if (ret) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2327  		dev_err(&dev->dev, "request_irq failed: %d\n", ret);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2328  		ret = -EBUSY;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2329  		goto failed_free_mem;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2330  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2331  
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2332  	ret = pxafb_smart_init(fbi);
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2333  	if (ret) {
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2334  		dev_err(&dev->dev, "failed to initialize smartpanel\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2335  		goto failed_free_mem;
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2336  	}
07df1c4fea1474 drivers/video/pxafb.c       Eric Miao          2008-12-04  2337  
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2338  	/*
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2339  	 * This makes sure that our colour bitfield
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2340  	 * descriptors are correctly initialised.
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2341  	 */
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2342  	ret = pxafb_check_var(&fbi->fb.var, &fbi->fb);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2343  	if (ret) {
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2344  		dev_err(&dev->dev, "failed to get suitable mode\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2345  		goto failed_free_mem;
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2346  	}
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2347  
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2348  	ret = pxafb_set_par(&fbi->fb);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2349  	if (ret) {
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2350  		dev_err(&dev->dev, "Failed to set parameters\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2351  		goto failed_free_mem;
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2352  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2353  
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2354  	platform_set_drvdata(dev, fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2355  
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2356  	ret = register_framebuffer(&fbi->fb);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2357  	if (ret < 0) {
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2358  		dev_err(&dev->dev,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2359  			"Failed to register framebuffer device: %d\n", ret);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2360  		goto failed_free_cmap;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2361  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2362  
198fc108ee4c2c drivers/video/pxafb.c       Eric Miao          2008-12-23  2363  	pxafb_overlay_init(fbi);
198fc108ee4c2c drivers/video/pxafb.c       Eric Miao          2008-12-23  2364
Andy Shevchenko Feb. 24, 2025, 10:58 a.m. UTC | #2
On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> Hi Raag,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> base:   b16e9f8547a328b19af59afc213ce323124d11e9
> patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
>     2236 |         int i, irq, ret;
>          |             ^

Ragg, please, fix this, and issue a v2 with the link to fixed PR:
https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.
Raag Jadav Feb. 24, 2025, 11:24 a.m. UTC | #3
On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > Hi Raag,
> > 
> > kernel test robot noticed the following build warnings:
> > 
> > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > 
> > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> >     2236 |         int i, irq, ret;
> >          |             ^
> 
> Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.

Sure, but perhaps wait a few days for review comments.

Raag
Andy Shevchenko Feb. 24, 2025, 11:41 a.m. UTC | #4
On Mon, Feb 24, 2025 at 01:24:08PM +0200, Raag Jadav wrote:
> On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> > On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > > Hi Raag,
> > > 
> > > kernel test robot noticed the following build warnings:
> > > 
> > > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > > 
> > > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > > 
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > > 
> > > All warnings (new ones prefixed by >>):
> > > 
> > >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> > >     2236 |         int i, irq, ret;
> > >          |             ^
> > 
> > Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> > https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.
> 
> Sure, but perhaps wait a few days for review comments.

Then perhaps answering to the cover letter that the maintainers who want to
apply should use the updated PR?
Raag Jadav Feb. 24, 2025, 12:22 p.m. UTC | #5
On Mon, Feb 24, 2025 at 01:41:05PM +0200, Andy Shevchenko wrote:
> On Mon, Feb 24, 2025 at 01:24:08PM +0200, Raag Jadav wrote:
> > On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> > > On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > > > Hi Raag,
> > > > 
> > > > kernel test robot noticed the following build warnings:
> > > > 
> > > > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > > > 
> > > > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > > > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > > > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > > > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > > > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > > > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > > > 
> > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > the same patch/commit), kindly add following tags
> > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > > > 
> > > > All warnings (new ones prefixed by >>):
> > > > 
> > > >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > > > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> > > >     2236 |         int i, irq, ret;
> > > >          |             ^
> > > 
> > > Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> > > https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.
> > 
> > Sure, but perhaps wait a few days for review comments.
> 
> Then perhaps answering to the cover letter that the maintainers who want to
> apply should use the updated PR?

Okay, but I'm not sure how this plays out for those who already pulled
the old PR, i.e. Sebastian.

Anything to worry about here?

Raag
Andy Shevchenko Feb. 24, 2025, 12:28 p.m. UTC | #6
On Mon, Feb 24, 2025 at 02:22:07PM +0200, Raag Jadav wrote:
> On Mon, Feb 24, 2025 at 01:41:05PM +0200, Andy Shevchenko wrote:
> > On Mon, Feb 24, 2025 at 01:24:08PM +0200, Raag Jadav wrote:
> > > On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> > > > On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > > > > Hi Raag,
> > > > > 
> > > > > kernel test robot noticed the following build warnings:
> > > > > 
> > > > > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > > > > 
> > > > > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > > > > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > > > > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > > > > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > > > > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > > > > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > > > > 
> > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > > the same patch/commit), kindly add following tags
> > > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > > > > 
> > > > > All warnings (new ones prefixed by >>):
> > > > > 
> > > > >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > > > > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> > > > >     2236 |         int i, irq, ret;
> > > > >          |             ^
> > > > 
> > > > Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> > > > https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.
> > > 
> > > Sure, but perhaps wait a few days for review comments.
> > 
> > Then perhaps answering to the cover letter that the maintainers who want to
> > apply should use the updated PR?
> 
> Okay, but I'm not sure how this plays out for those who already pulled
> the old PR, i.e. Sebastian.
> 
> Anything to worry about here?

I already informed him and Stephen about a new PR I just sent a few hours ago.
diff mbox series

Patch

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 4aa84853e31a..21fba33918c6 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2239,26 +2239,21 @@  static int pxafb_probe(struct platform_device *dev)
 
 	ret = -ENOMEM;
 	pdata = dev_get_platdata(&dev->dev);
-	inf = devm_kmalloc(&dev->dev, sizeof(*inf), GFP_KERNEL);
-	if (!inf)
-		goto failed;
-
 	if (pdata) {
-		*inf = *pdata;
-		inf->modes =
-			devm_kmalloc_array(&dev->dev, pdata->num_modes,
-					   sizeof(inf->modes[0]), GFP_KERNEL);
+		inf = devm_kmemdup(&dev->dev, pdata, sizeof(*pdata), GFP_KERNEL);
+		if (!inf)
+			goto failed;
+
+		inf->modes = devm_kmemdup_array(&dev->dev, pdata->modes, pdata->num_modes,
+						sizeof(*pdata->modes), GFP_KERNEL);
 		if (!inf->modes)
 			goto failed;
-		for (i = 0; i < inf->num_modes; i++)
-			inf->modes[i] = pdata->modes[i];
 	} else {
 		inf = of_pxafb_of_mach_info(&dev->dev);
+		if (IS_ERR_OR_NULL(inf))
+			goto failed;
 	}
 
-	if (IS_ERR_OR_NULL(inf))
-		goto failed;
-
 	ret = pxafb_parse_options(&dev->dev, g_options, inf);
 	if (ret < 0)
 		goto failed;