[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)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




---------- Forwarded message ----------
Date: Mon, 1 Jan 2024 03:31:24 +0800
From: kernel test robot <lkp@xxxxxxxxx>
To: oe-kbuild@xxxxxxxxxxxxxxx
Cc: lkp@xxxxxxxxx, Julia Lawall <julia.lawall@xxxxxxxx>
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@xxxxxxxxx
CC: oe-kbuild-all@xxxxxxxxxxxxxxx
CC: Linux Memory Management List <linux-mm@xxxxxxxxx>
TO: Alain Volmat <alain.volmat@xxxxxxxxxxx>
CC: Hans Verkuil <hverkuil@xxxxxxxxx>
CC: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>

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

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux