CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: "Greg Kroah-Hartman" <[email protected]>
CC: Jiri Slaby <[email protected]>
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/tty/goldfish.c:95:12-13: 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:   23d04328444a8fa0ca060c5e532220dac8e8bc26
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax 
script
:::::: branch date: 25 hours ago
:::::: commit date: 10 months ago

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

 drivers/tty/goldfish.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -92,7 +92,7 @@ static void goldfish_tty_rw(struct goldf
                while (addr < addr_end) {
                        unsigned long pg_end = (addr & PAGE_MASK) + PAGE_SIZE;
                        unsigned long next =
-                                       pg_end < addr_end ? pg_end : addr_end;
+                                       min(pg_end, addr_end);
                        unsigned long avail = next - addr;
 
                        /*
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to