CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: "Greg Kroah-Hartman" CC: Jiri Slaby CC: linux-kernel(a)vger.kernel.org From: kernel test robot 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 Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 59250f8a7f3a60a2661b84cbafc1e0eb5d05ec9b commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script :::::: branch date: 19 hours ago :::::: commit date: 12 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; /*