CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: Thomas Bogendoerfer <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

arch/mips/sibyte/common/sb_tbprof.c:462:19-20: 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

CC: Denis Efremov <[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:   f443e374ae131c168a065ea1748feac6b2e76613
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax 
script
:::::: branch date: 16 hours ago
:::::: commit date: 11 months ago

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

 arch/mips/sibyte/common/sb_tbprof.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -459,7 +459,7 @@ static ssize_t sbprof_tb_read(struct fil
        while (size && (cur_sample < sbp.next_tb_sample)) {
                int err;
 
-               cur_count = size < sample_left ? size : sample_left;
+               cur_count = min(size, sample_left);
                src = (char *)(((long)sbp.sbprof_tbbuf[cur_sample])+sample_off);
                err = __copy_to_user(dest, src, cur_count);
                if (err) {
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to