All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/video/fbdev/omap2/omapfb/dss/dispc.c:2392:21-22: WARNING opportunity for max()
@ 2026-10-06  6:10 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-06  6:10 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Chintan Patel <chintanlike@gmail.com>
CC: Helge Deller <deller@gmx.de>
CC: Thomas Zimmermann <tzimmermann@suse.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c3418fffa9d037b2038a6db48be63f9e2291806
commit: bf9ec461a7d1b82bbc3fe110fba9e9533879849d fbdev: omapfb: Make FB_DEVICE dependency optional
date:   8 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 8 months ago
config: powerpc64-randconfig-r2104-20261005 (https://download.01.org/0day-ci/archive/20261006/202610060856.DAXkynw7-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 195c81658995a4b7531c30a12c5aef6cf2bbd671)

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
| Fixes: bf9ec461a7d1 ("fbdev: omapfb: Make FB_DEVICE dependency optional")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202610060856.DAXkynw7-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/video/fbdev/omap2/omapfb/dss/dispc.c:2392:21-22: WARNING opportunity for max()

vim +2392 drivers/video/fbdev/omap2/omapfb/dss/dispc.c

f76ee892a99e68b Tomi Valkeinen 2015-12-09  2368  
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2369  static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk,
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2370  		const struct omap_video_timings *mgr_timings,
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2371  		u16 width, u16 height, u16 out_width, u16 out_height,
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2372  		enum omap_color_mode color_mode, bool *five_taps,
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2373  		int *x_predecim, int *y_predecim, int *decim_x, int *decim_y,
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2374  		u16 pos_x, unsigned long *core_clk, bool mem_to_mem)
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2375  {
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2376  	u16 in_width, in_width_max;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2377  	int decim_x_min = *decim_x;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2378  	u16 in_height = height / *decim_y;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2379  	const int maxsinglelinewidth =
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2380  				dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2381  	const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2382  
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2383  	if (mem_to_mem) {
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2384  		in_width_max = out_width * maxdownscale;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2385  	} else {
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2386  		in_width_max = dispc_core_clk_rate() /
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2387  					DIV_ROUND_UP(pclk, out_width);
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2388  	}
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2389  
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2390  	*decim_x = DIV_ROUND_UP(width, in_width_max);
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2391  
f76ee892a99e68b Tomi Valkeinen 2015-12-09 @2392  	*decim_x = *decim_x > decim_x_min ? *decim_x : decim_x_min;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2393  	if (*decim_x > *x_predecim)
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2394  		return -EINVAL;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2395  
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2396  	do {
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2397  		in_width = width / *decim_x;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2398  	} while (*decim_x <= *x_predecim &&
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2399  			in_width > maxsinglelinewidth && ++*decim_x);
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2400  
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2401  	if (in_width > maxsinglelinewidth) {
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2402  		DSSERR("Cannot scale width exceeds max line width");
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2403  		return -EINVAL;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2404  	}
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2405  
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2406  	*core_clk = dispc.feat->calc_core_clk(pclk, in_width, in_height,
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2407  				out_width, out_height, mem_to_mem);
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2408  	return 0;
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2409  }
f76ee892a99e68b Tomi Valkeinen 2015-12-09  2410  

:::::: The code at line 2392 was first introduced by commit
:::::: f76ee892a99e68b55402b8d4b8aeffcae2aff34d omapfb: copy omapdss & displays for omapfb

:::::: TO: Tomi Valkeinen <tomi.valkeinen@ti.com>
:::::: CC: Tomi Valkeinen <tomi.valkeinen@ti.com>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-06  6:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-06  6:10 drivers/video/fbdev/omap2/omapfb/dss/dispc.c:2392:21-22: WARNING opportunity for max() kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.