CC: [email protected]
BCC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: Karol Kolacinski <[email protected]>
CC: Sudhansu Sekhar Mishra <[email protected]>
CC: Tony Nguyen <[email protected]>
CC: Jesse Brandeburg <[email protected]>
CC: Jakub Kicinski <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

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 <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

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),
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to