CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Mark Pearson <[email protected]>
CC: Hans de Goede <[email protected]>
CC: Mark Gross <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/platform/x86/think-lmi.c:284:32-33: 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: 640a5fa50a42 ("platform/x86: think-lmi: Opcode support")
CC: Mark Pearson <[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/torvalds/linux.git 
master
head:   34e047aa16c0123bbae8e2f6df33e5ecc1f56601
commit: 640a5fa50a42b99bfa2a0ec51b4ea9591d9bd055 platform/x86: think-lmi: 
Opcode support
:::::: branch date: 7 hours ago
:::::: commit date: 4 months ago

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

 drivers/platform/x86/think-lmi.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/platform/x86/think-lmi.c
+++ b/drivers/platform/x86/think-lmi.c
@@ -281,8 +281,7 @@ static int tlmi_get_pwd_settings(struct
                return -EIO;
        }
 
-       copy_size = obj->buffer.length < sizeof(struct tlmi_pwdcfg) ?
-               obj->buffer.length : sizeof(struct tlmi_pwdcfg);
+       copy_size = min(obj->buffer.length, sizeof(struct tlmi_pwdcfg));
        memcpy(pwdcfg, obj->buffer.pointer, copy_size);
        kfree(obj);
 
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to