All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ice: fix minmax.cocci warnings
  2022-03-17 12:58 [linux-next:master 9448/13392] drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min() kernel test robot
@ 2022-03-17 12:56 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-03-17 12:56 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2069 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Karol Kolacinski <karol.kolacinski@intel.com>
CC: Sudhansu Sekhar Mishra <sudhansu.mishra@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: intel-wired-lan(a)lists.osuosl.org
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min()


 Check for opencoded min(), max() implementations.
 Generated patches sometimes require adding a cast to fix compile warning.
 Warnings/patches scope intentionally limited to a function body.

Generated by: scripts/coccinelle/misc/minmax.cocci

Fixes: 43113ff73453 ("ice: add TTY for GNSS module for E810T device")
CC: Karol Kolacinski <karol.kolacinski@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8a11187eb62b8b910d2c5484e1f5d160e8b11eb4
commit: 43113ff73453c231af2c8e700cb4ff8bca97cff6 [9448/13392] ice: add TTY for GNSS module for E810T device
:::::: branch date: 26 hours ago
:::::: commit date: 2 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/net/ethernet/intel/ice/ice_gnss.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/net/ethernet/intel/ice/ice_gnss.c
+++ b/drivers/net/ethernet/intel/ice/ice_gnss.c
@@ -76,8 +76,7 @@ static void ice_gnss_read(struct kthread
 	for (i = 0; i < data_len; i += bytes_read) {
 		u16 bytes_left = data_len - i;
 
-		bytes_read = bytes_left < ICE_MAX_I2C_DATA_SIZE ? bytes_left :
-					  ICE_MAX_I2C_DATA_SIZE;
+		bytes_read = min(bytes_left, ICE_MAX_I2C_DATA_SIZE);
 
 		err = ice_aq_read_i2c(hw, link_topo, ICE_GNSS_UBX_I2C_BUS_ADDR,
 				      cpu_to_le16(ICE_GNSS_UBX_EMPTY_DATA),

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [linux-next:master 9448/13392] drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min()
@ 2022-03-17 12:58 kernel test robot
  2022-03-17 12:56 ` [PATCH] ice: fix minmax.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-03-17 12:58 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Karol Kolacinski <karol.kolacinski@intel.com>
CC: Sudhansu Sekhar Mishra <sudhansu.mishra@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8a11187eb62b8b910d2c5484e1f5d160e8b11eb4
commit: 43113ff73453c231af2c8e700cb4ff8bca97cff6 [9448/13392] ice: add TTY for GNSS module for E810T device
:::::: branch date: 26 hours ago
:::::: commit date: 2 weeks ago
config: s390-randconfig-c004-20220316 (https://download.01.org/0day-ci/archive/20220317/202203172024.e1x75mdU-lkp(a)intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min()

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-17 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17 12:58 [linux-next:master 9448/13392] drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min() kernel test robot
2022-03-17 12:56 ` [PATCH] ice: fix minmax.cocci warnings 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.