dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Emil Velikov <emil.l.velikov@gmail.com>, dri-devel@lists.freedesktop.org
Cc: emil.l.velikov@gmail.com, kbuild-all@lists.01.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [PATCH] linux/bits.h: adjust GENMASK_INPUT_CHECK() check
Date: Tue, 19 May 2020 22:46:57 +0800	[thread overview]
Message-ID: <202005192248.hhYtuqDw%lkp@intel.com> (raw)
In-Reply-To: <20200519101320.33495-1-emil.l.velikov@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 14158 bytes --]

Hi Emil,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tegra-drm/drm/tegra/for-next]
[also build test WARNING on linus/master v5.7-rc6 next-20200518]
[cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Emil-Velikov/linux-bits-h-adjust-GENMASK_INPUT_CHECK-check/20200519-205452
base:   git://anongit.freedesktop.org/tegra/linux.git drm/tegra/for-next
config: arc-defconfig (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/bits.h:23,
from include/linux/bitops.h:5,
from drivers/clk/clk-multiplier.c:6:
drivers/clk/clk-multiplier.c: In function 'clk_multiplier_recalc_rate':
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
>> drivers/clk/clk-multiplier.c:48:9: note: in expansion of macro 'GENMASK'
48 |  val &= GENMASK(mult->width - 1, 0);
|         ^~~~~~~
drivers/clk/clk-multiplier.c: In function 'clk_multiplier_set_rate':
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
drivers/clk/clk-multiplier.c:139:10: note: in expansion of macro 'GENMASK'
139 |  val &= ~GENMASK(mult->width + mult->shift - 1, mult->shift);
|          ^~~~~~~
--
In file included from include/linux/bits.h:23,
from include/linux/bitops.h:5,
from include/linux/of.h:15,
from include/linux/clk-provider.h:9,
from drivers/clk/clk-fractional-divider.c:10:
drivers/clk/clk-fractional-divider.c: In function 'clk_fd_general_approximation':
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
>> drivers/clk/clk-fractional-divider.c:88:4: note: in expansion of macro 'GENMASK'
88 |    GENMASK(fd->mwidth - 1, 0), GENMASK(fd->nwidth - 1, 0),
|    ^~~~~~~
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
drivers/clk/clk-fractional-divider.c:88:32: note: in expansion of macro 'GENMASK'
88 |    GENMASK(fd->mwidth - 1, 0), GENMASK(fd->nwidth - 1, 0),
|                                ^~~~~~~
drivers/clk/clk-fractional-divider.c: In function 'clk_fd_set_rate':
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
drivers/clk/clk-fractional-divider.c:122:4: note: in expansion of macro 'GENMASK'
122 |    GENMASK(fd->mwidth - 1, 0), GENMASK(fd->nwidth - 1, 0),
|    ^~~~~~~
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
drivers/clk/clk-fractional-divider.c:122:32: note: in expansion of macro 'GENMASK'
122 |    GENMASK(fd->mwidth - 1, 0), GENMASK(fd->nwidth - 1, 0),
|                                ^~~~~~~
drivers/clk/clk-fractional-divider.c: In function 'clk_hw_register_fractional_divider':
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
drivers/clk/clk-fractional-divider.c:178:14: note: in expansion of macro 'GENMASK'
178 |  fd->mmask = GENMASK(mwidth - 1, 0) << mshift;
|              ^~~~~~~
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
drivers/clk/clk-fractional-divider.c:181:14: note: in expansion of macro 'GENMASK'
181 |  fd->nmask = GENMASK(nwidth - 1, 0) << nshift;
|              ^~~~~~~
--
In file included from include/linux/bits.h:23,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/interrupt.h:6,
from drivers/clocksource/arc_timer.c:15:
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:45:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
45 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
|   ^~~~~~~~~~~~~~~~~~~
include/linux/clocksource.h:136:32: note: in expansion of macro 'GENMASK_ULL'
136 | #define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0)
|                                ^~~~~~~~~~~
>> drivers/clocksource/arc_timer.c:99:12: note: in expansion of macro 'CLOCKSOURCE_MASK'
99 |  .mask   = CLOCKSOURCE_MASK(64),
|            ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:45:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
45 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
|   ^~~~~~~~~~~~~~~~~~~
include/linux/clocksource.h:136:32: note: in expansion of macro 'GENMASK_ULL'
136 | #define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0)
|                                ^~~~~~~~~~~
drivers/clocksource/arc_timer.c:157:12: note: in expansion of macro 'CLOCKSOURCE_MASK'
157 |  .mask   = CLOCKSOURCE_MASK(64),
|            ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:45:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
45 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
|   ^~~~~~~~~~~~~~~~~~~
include/linux/clocksource.h:136:32: note: in expansion of macro 'GENMASK_ULL'
136 | #define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0)
|                                ^~~~~~~~~~~
drivers/clocksource/arc_timer.c:210:12: note: in expansion of macro 'CLOCKSOURCE_MASK'
210 |  .mask   = CLOCKSOURCE_MASK(32),
|            ^~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/module.h:12,
from net/core/filter.c:20:
net/core/filter.c: In function '____bpf_skb_set_tunnel_opt':
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
|                                          ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
include/net/ip_tunnels.h:66:2: note: in expansion of macro 'GENMASK'
66 |  GENMASK((sizeof_field(struct ip_tunnel_info,           |  ^~~~~~~
net/core/filter.c:3945:22: note: in expansion of macro 'IP_TUNNEL_OPTS_MAX'
3945 |  if (unlikely(size > IP_TUNNEL_OPTS_MAX))
|                      ^~~~~~~~~~~~~~~~~~
In file included from include/linux/bits.h:23,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from net/core/filter.c:20:
net/core/filter.c: In function 'bpf_get_skb_set_tunnel_proto':
include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(!__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
include/net/ip_tunnels.h:66:2: note: in expansion of macro 'GENMASK'
66 |  GENMASK((sizeof_field(struct ip_tunnel_info,           |  ^~~~~~~
net/core/filter.c:3968:35: note: in expansion of macro 'IP_TUNNEL_OPTS_MAX'
3968 |   tmp = metadata_dst_alloc_percpu(IP_TUNNEL_OPTS_MAX,
|                                   ^~~~~~~~~~~~~~~~~~
In file included from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from net/core/filter.c:20:
>> include/linux/bits.h:39:2: warning: conversion from 'long unsigned int' to 'u8' {aka 'unsigned char'} changes value from '256' to '0' [-Woverflow]
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/ip_tunnels.h:66:2: note: in expansion of macro 'GENMASK'
66 |  GENMASK((sizeof_field(struct ip_tunnel_info,           |  ^~~~~~~
net/core/filter.c:3968:35: note: in expansion of macro 'IP_TUNNEL_OPTS_MAX'
3968 |   tmp = metadata_dst_alloc_percpu(IP_TUNNEL_OPTS_MAX,
|                                   ^~~~~~~~~~~~~~~~~~

vim +39 include/linux/bits.h

295bcca84916cb Rikard Falkeborn 2020-04-06  34  
295bcca84916cb Rikard Falkeborn 2020-04-06  35  #define __GENMASK(h, l) \
95b980d62d52c4 Masahiro Yamada  2019-07-16  36  	(((~UL(0)) - (UL(1) << (l)) + 1) & \
95b980d62d52c4 Masahiro Yamada  2019-07-16  37  	 (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
295bcca84916cb Rikard Falkeborn 2020-04-06  38  #define GENMASK(h, l) \
295bcca84916cb Rikard Falkeborn 2020-04-06 @39  	(GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
8bd9cb51daac89 Will Deacon      2018-06-19  40  

:::::: The code at line 39 was first introduced by commit
:::::: 295bcca84916cb5079140a89fccb472bb8d1f6e2 linux/bits.h: add compile time sanity check of GENMASK inputs

:::::: TO: Rikard Falkeborn <rikard.falkeborn@gmail.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 9325 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-05-19 14:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 10:13 [PATCH] linux/bits.h: adjust GENMASK_INPUT_CHECK() check Emil Velikov
2020-05-19 14:46 ` kbuild test robot [this message]
2020-05-19 15:04 ` kbuild test robot
2020-05-19 21:14 ` [PATCH v2] " Emil Velikov
2020-05-19 21:28   ` Rikard Falkeborn
2020-05-22 18:50     ` Emil Velikov
2020-05-23 19:35       ` Rikard Falkeborn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202005192248.hhYtuqDw%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=rikard.falkeborn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).