linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 3789/10295] drivers/media/i2c/st-mipid02.c:396:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead. (fwd)
@ 2023-12-31 19:43 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2023-12-31 19:43 UTC (permalink / raw)
  To: Alain Volmat, Hans Verkuil, Sakari Ailus
  Cc: Linux Memory Management List, oe-kbuild-all



---------- Forwarded message ----------
Date: Mon, 1 Jan 2024 03:31:24 +0800
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [linux-next:master 3789/10295] drivers/media/i2c/st-mipid02.c:396:1-7:
    WARNING: do_div() does a 64-by-32 division,
    please consider using div64_s64 instead.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Alain Volmat <alain.volmat@foss.st.com>
CC: Hans Verkuil <hverkuil@xs4all.nl>
CC: Sakari Ailus <sakari.ailus@linux.intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   39676dfe52331dba909c617f213fdb21015c8d10
commit: 046ee0e2a4d602268a49be0d77df8c85559015e3 [3789/10295] media: i2c: st-mipid02: add usage of v4l2_get_link_freq
:::::: branch date: 10 days ago
:::::: commit date: 4 weeks ago
config: hexagon-randconfig-r052-20231228 (https://download.01.org/0day-ci/archive/20240101/202401010329.u5sLmCCj-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project d3ef86708241a3bee902615c190dead1638c4e09)

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202401010329.u5sLmCCj-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/media/i2c/st-mipid02.c:396:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead.

vim +396 drivers/media/i2c/st-mipid02.c

642bb5e88fed89 Mickael Guene  2019-04-09  369
642bb5e88fed89 Mickael Guene  2019-04-09  370  /*
642bb5e88fed89 Mickael Guene  2019-04-09  371   * We need to know link frequency to setup clk_lane_reg1 timings. Link frequency
046ee0e2a4d602 Alain Volmat   2023-11-25  372   * will be retrieve from connected device via v4l2_get_link_freq, bit per pixel
642bb5e88fed89 Mickael Guene  2019-04-09  373   * and number of lanes.
642bb5e88fed89 Mickael Guene  2019-04-09  374   */
642bb5e88fed89 Mickael Guene  2019-04-09  375  static int mipid02_configure_from_rx_speed(struct mipid02_dev *bridge)
642bb5e88fed89 Mickael Guene  2019-04-09  376  {
642bb5e88fed89 Mickael Guene  2019-04-09  377  	struct i2c_client *client = bridge->i2c_client;
642bb5e88fed89 Mickael Guene  2019-04-09  378  	struct v4l2_subdev *subdev = bridge->s_subdev;
046ee0e2a4d602 Alain Volmat   2023-11-25  379  	struct v4l2_fwnode_endpoint *ep = &bridge->rx;
046ee0e2a4d602 Alain Volmat   2023-11-25  380  	u32 bpp = bpp_from_code(bridge->fmt.code);
046ee0e2a4d602 Alain Volmat   2023-11-25  381  	/*
046ee0e2a4d602 Alain Volmat   2023-11-25  382  	 * clk_lane_reg1 requires 4 times the unit interval time, and bitrate
046ee0e2a4d602 Alain Volmat   2023-11-25  383  	 * is twice the link frequency, hence ui_4 = 1000000000 * 4 / 2
046ee0e2a4d602 Alain Volmat   2023-11-25  384  	 */
046ee0e2a4d602 Alain Volmat   2023-11-25  385  	u64 ui_4 = 2000000000;
046ee0e2a4d602 Alain Volmat   2023-11-25  386  	s64 link_freq;
642bb5e88fed89 Mickael Guene  2019-04-09  387
046ee0e2a4d602 Alain Volmat   2023-11-25  388  	link_freq = v4l2_get_link_freq(subdev->ctrl_handler, bpp,
046ee0e2a4d602 Alain Volmat   2023-11-25  389  				       2 * ep->bus.mipi_csi2.num_data_lanes);
046ee0e2a4d602 Alain Volmat   2023-11-25  390  	if (link_freq < 0) {
6a381d1072f174 Hugues Fruchet 2019-06-17  391  		dev_err(&client->dev, "Failed to get link frequency");
642bb5e88fed89 Mickael Guene  2019-04-09  392  		return -EINVAL;
642bb5e88fed89 Mickael Guene  2019-04-09  393  	}
642bb5e88fed89 Mickael Guene  2019-04-09  394
046ee0e2a4d602 Alain Volmat   2023-11-25  395  	dev_dbg(&client->dev, "detect link_freq = %lld Hz", link_freq);
046ee0e2a4d602 Alain Volmat   2023-11-25 @396  	do_div(ui_4, link_freq);
046ee0e2a4d602 Alain Volmat   2023-11-25  397  	bridge->r.clk_lane_reg1 |= ui_4 << 2;
642bb5e88fed89 Mickael Guene  2019-04-09  398
642bb5e88fed89 Mickael Guene  2019-04-09  399  	return 0;
642bb5e88fed89 Mickael Guene  2019-04-09  400  }
642bb5e88fed89 Mickael Guene  2019-04-09  401

-- 
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:[~2023-12-31 19:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-31 19:43 [linux-next:master 3789/10295] drivers/media/i2c/st-mipid02.c:396:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead. (fwd) Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox