* drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
@ 2021-09-09 18:55 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-09-09 18:55 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 16643 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Sakari Ailus <sakari.ailus@linux.intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a3fa7a101dcff93791d1b1bdb3affcad1410c8c1
commit: e43ccb0a045f34838b786e8021dc4838b4af5c38 media: i2c: Add support for the OV5648 image sensor
date: 8 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 8 months ago
config: x86_64-randconfig-c007-20210907 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9c476172b93367d2cb88d7d3f4b1b5b456fa6020)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e43ccb0a045f34838b786e8021dc4838b4af5c38
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e43ccb0a045f34838b786e8021dc4838b4af5c38
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
drivers/hid/hid-topseed.c:30:6: note: Assuming the condition is false
if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-topseed.c:30:2: note: Taking false branch
if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
^
drivers/hid/hid-topseed.c:33:2: note: Control jumps to 'case 90:' at line 51
switch (usage->hid & HID_USAGE) {
^
drivers/hid/hid-topseed.c:51:14: note: Calling 'hid_map_usage_clear'
case 0x05a: ts_map_key_clear(KEY_TEXT); break;
^
drivers/hid/hid-topseed.c:24:29: note: expanded from macro 'ts_map_key_clear'
#define ts_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/hid.h:1020:2: note: Calling 'hid_map_usage'
hid_map_usage(hidinput, usage, bit, max, type, c);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/hid.h:974:2: note: 'input' initialized here
struct input_dev *input = hidinput->input;
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/hid.h:978:2: note: Control jumps to 'case 1:' at line 987
switch (type) {
^
include/linux/hid.h:990:3: note: Execution continues on line 997
break;
^
include/linux/hid.h:997:15: note: 'c' is <= 'limit'
if (unlikely(c > limit || !bmap)) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/hid.h:997:15: note: Left side of '||' is false
if (unlikely(c > limit || !bmap)) {
^
include/linux/hid.h:997:28: note: Assuming 'bmap' is null
if (unlikely(c > limit || !bmap)) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/hid.h:997:28: note: Assuming pointer value is null
if (unlikely(c > limit || !bmap)) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/hid.h:997:2: note: Taking true branch
if (unlikely(c > limit || !bmap)) {
^
include/linux/hid.h:998:3: note: Assuming the condition is true
pr_warn_ratelimited("%s: Invalid code %d type %d\n",
^
include/linux/printk.h:528:2: note: expanded from macro 'pr_warn_ratelimited'
printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:511:6: note: expanded from macro 'printk_ratelimited'
if (__ratelimit(&_rs)) \
^~~~~~~~~~~~~~~~~
include/linux/ratelimit_types.h:41:28: note: expanded from macro '__ratelimit'
#define __ratelimit(state) ___ratelimit(state, __func__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/hid.h:998:3: note: Taking true branch
pr_warn_ratelimited("%s: Invalid code %d type %d\n",
^
include/linux/printk.h:528:2: note: expanded from macro 'pr_warn_ratelimited'
printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^
include/linux/printk.h:511:2: note: expanded from macro 'printk_ratelimited'
if (__ratelimit(&_rs)) \
^
include/linux/hid.h:999:9: note: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'input')
input->name, c, type);
^
include/linux/printk.h:528:49: note: expanded from macro 'pr_warn_ratelimited'
printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/printk.h:512:17: note: expanded from macro 'printk_ratelimited'
printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
drivers/media/i2c/ov5640.c:1005:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = ov5640_mod_reg(sensor, OV5640_REG_SC_PLL_CTRL0,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov5640.c:1005:2: note: Value stored to 'ret' is never read
ret = ov5640_mod_reg(sensor, OV5640_REG_SC_PLL_CTRL0,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
>> drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
Optimal fields order:
pll2_config,
register_values,
pll1_config,
crop_start_x,
offset_x,
output_size_x,
crop_end_x,
hts,
crop_start_y,
offset_y,
output_size_y,
crop_end_y,
vts,
inc_x_odd,
inc_x_even,
inc_y_odd,
inc_y_even,
register_values_count,
frame_interval,
binning_x,
binning_y,
consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
drivers/media/i2c/ov5648.c:587:8: note: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal). Optimal fields order: pll2_config, register_values, pll1_config, crop_start_x, offset_x, output_size_x, crop_end_x, hts, crop_start_y, offset_y, output_size_y, crop_end_y, vts, inc_x_odd, inc_x_even, inc_y_odd, inc_y_even, register_values_count, frame_interval, binning_x, binning_y, consider reordering the fields or adding explicit padding members
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
drivers/media/i2c/ov7670.c:1291:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = ov7670_read(sd, REG_CMATRIX_SIGN, &signbits);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:1291:2: note: Value stored to 'ret' is never read
ret = ov7670_read(sd, REG_CMATRIX_SIGN, &signbits);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:1527:15: warning: The left operand of '&' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
com1 = (com1 & 0xfc) | (value & 0x03);
^
drivers/media/i2c/ov7670.c:1596:2: note: Control jumps to 'case 10094849:' at line 1616
switch (ctrl->id) {
^
drivers/media/i2c/ov7670.c:1619:7: note: Assuming field 'val' is equal to V4L2_EXPOSURE_MANUAL
if (ctrl->val == V4L2_EXPOSURE_MANUAL) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:1619:3: note: Taking true branch
if (ctrl->val == V4L2_EXPOSURE_MANUAL) {
^
drivers/media/i2c/ov7670.c:1621:11: note: Calling 'ov7670_s_exp'
return ov7670_s_exp(sd, info->exposure->val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:1519:16: note: 'com1' declared without an initial value
unsigned char com1, com8, aech, aechh;
^~~~
drivers/media/i2c/ov7670.c:1521:8: note: Calling 'ov7670_read'
ret = ov7670_read(sd, REG_COM1, &com1) +
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:565:6: note: Assuming field 'use_smbus' is true
if (info->use_smbus)
^~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:565:2: note: Taking true branch
if (info->use_smbus)
^
drivers/media/i2c/ov7670.c:566:10: note: Calling 'ov7670_read_smbus'
return ov7670_read_smbus(sd, reg, value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:485:6: note: Assuming 'ret' is < 0
if (ret >= 0) {
^~~~~~~~
drivers/media/i2c/ov7670.c:485:2: note: Taking false branch
if (ret >= 0) {
^
drivers/media/i2c/ov7670.c:489:2: note: Returning without writing to '*value'
return ret;
^
drivers/media/i2c/ov7670.c:566:10: note: Returning from 'ov7670_read_smbus'
return ov7670_read_smbus(sd, reg, value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:566:3: note: Returning without writing to '*value'
return ov7670_read_smbus(sd, reg, value);
^
drivers/media/i2c/ov7670.c:1521:8: note: Returning from 'ov7670_read'
ret = ov7670_read(sd, REG_COM1, &com1) +
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov7670.c:1524:6: note: Assuming 'ret' is 0
if (ret)
^~~
vim +587 drivers/media/i2c/ov5648.c
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 575
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 576 /*
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 577 * General formulas for (array-centered) mode calculation:
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 578 * - photo_array_width = 2624
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 579 * - crop_start_x = (photo_array_width - output_size_x) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 580 * - crop_end_x = crop_start_x + offset_x + output_size_x - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 581 *
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 582 * - photo_array_height = 1956
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 583 * - crop_start_y = (photo_array_height - output_size_y) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 584 * - crop_end_y = crop_start_y + offset_y + output_size_y - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 585 */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 586
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 @587 struct ov5648_mode {
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 588 unsigned int crop_start_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 589 unsigned int offset_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 590 unsigned int output_size_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 591 unsigned int crop_end_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 592 unsigned int hts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 593
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 594 unsigned int crop_start_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 595 unsigned int offset_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 596 unsigned int output_size_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 597 unsigned int crop_end_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 598 unsigned int vts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 599
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 600 bool binning_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 601 bool binning_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 602
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 603 unsigned int inc_x_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 604 unsigned int inc_x_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 605 unsigned int inc_y_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 606 unsigned int inc_y_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 607
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 608 /* 8-bit frame interval followed by 10-bit frame interval. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 609 struct v4l2_fract frame_interval[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 610
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 611 /* 8-bit config followed by 10-bit config. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 612 const struct ov5648_pll1_config *pll1_config[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 613 const struct ov5648_pll2_config *pll2_config;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 614
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 615 const struct ov5648_register_value *register_values;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 616 unsigned int register_values_count;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 617 };
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 618
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32600 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
@ 2021-12-18 14:14 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-12-18 14:14 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 17296 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Sakari Ailus <sakari.ailus@linux.intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9eaa88c7036eda3f6c215f87ca693594cf90559b
commit: e43ccb0a045f34838b786e8021dc4838b4af5c38 media: i2c: Add support for the OV5648 image sensor
date: 11 months ago
:::::: branch date: 13 hours ago
:::::: commit date: 11 months ago
config: x86_64-randconfig-c007-20211218 (https://download.01.org/0day-ci/archive/20211218/202112182239.n6gt5N4i-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9043c3d65b11b442226015acfbf8167684586cfa)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e43ccb0a045f34838b786e8021dc4838b4af5c38
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e43ccb0a045f34838b786e8021dc4838b4af5c38
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
include/linux/compiler_types.h:306:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
net/netlink/genetlink.c:1421:2: note: Loop condition is false. Exiting loop
for_each_net_rcu(net) {
^
include/net/net_namespace.h:336:2: note: expanded from macro 'for_each_net_rcu'
list_for_each_entry_rcu(VAR, &net_namespace_list, list)
^
include/linux/rculist.h:392:13: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member); \
^
include/linux/rculist.h:316:15: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:304:2: note: expanded from macro '__compiletime_assert'
do { \
^
net/netlink/genetlink.c:1421:2: note: Left side of '&&' is false
for_each_net_rcu(net) {
^
include/net/net_namespace.h:336:2: note: expanded from macro 'for_each_net_rcu'
list_for_each_entry_rcu(VAR, &net_namespace_list, list)
^
include/linux/rculist.h:392:13: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member); \
^
include/linux/rculist.h:316:2: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/linux/kernel.h:694:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
net/netlink/genetlink.c:1421:2: note: Taking false branch
for_each_net_rcu(net) {
^
include/net/net_namespace.h:336:2: note: expanded from macro 'for_each_net_rcu'
list_for_each_entry_rcu(VAR, &net_namespace_list, list)
^
include/linux/rculist.h:392:13: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member); \
^
include/linux/rculist.h:316:2: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
net/netlink/genetlink.c:1421:2: note: Loop condition is false. Exiting loop
for_each_net_rcu(net) {
^
include/net/net_namespace.h:336:2: note: expanded from macro 'for_each_net_rcu'
list_for_each_entry_rcu(VAR, &net_namespace_list, list)
^
include/linux/rculist.h:392:13: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu((head)->next, typeof(*pos), member); \
^
include/linux/rculist.h:316:2: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:304:2: note: expanded from macro '__compiletime_assert'
do { \
^
net/netlink/genetlink.c:1421:2: note: Loop condition is false. Execution continues on line 1439
for_each_net_rcu(net) {
^
include/net/net_namespace.h:336:2: note: expanded from macro 'for_each_net_rcu'
list_for_each_entry_rcu(VAR, &net_namespace_list, list)
^
include/linux/rculist.h:391:2: note: expanded from macro 'list_for_each_entry_rcu'
for (__list_check_rcu(dummy, ## cond, 0), \
^
net/netlink/genetlink.c:1439:24: note: Access to field 'genl_sock' results in a dereference of a null pointer (loaded from variable 'prev')
err = nlmsg_multicast(prev->genl_sock, skb, portid, group, flags);
^~~~
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
>> drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
Optimal fields order:
pll2_config,
register_values,
pll1_config,
crop_start_x,
offset_x,
output_size_x,
crop_end_x,
hts,
crop_start_y,
offset_y,
output_size_y,
crop_end_y,
vts,
inc_x_odd,
inc_x_even,
inc_y_odd,
inc_y_even,
register_values_count,
frame_interval,
binning_x,
binning_y,
consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
drivers/media/i2c/ov5648.c:587:8: note: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal). Optimal fields order: pll2_config, register_values, pll1_config, crop_start_x, offset_x, output_size_x, crop_end_x, hts, crop_start_y, offset_y, output_size_y, crop_end_y, vts, inc_x_odd, inc_x_even, inc_y_odd, inc_y_even, register_values_count, frame_interval, binning_x, binning_y, consider reordering the fields or adding explicit padding members
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
drivers/regulator/core.c:1127:2: warning: Value stored to 'count' is never read [clang-analyzer-deadcode.DeadStores]
count += scnprintf(buf + count, len - count, ", %s",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/core.c:1127:2: note: Value stored to 'count' is never read
count += scnprintf(buf + count, len - count, ", %s",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/core.c:3671:3: warning: Value stored to 'possible_uV' is never read [clang-analyzer-deadcode.DeadStores]
possible_uV = desired_min_uV;
^ ~~~~~~~~~~~~~~
drivers/regulator/core.c:3671:3: note: Value stored to 'possible_uV' is never read
possible_uV = desired_min_uV;
^ ~~~~~~~~~~~~~~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
drivers/extcon/extcon-max77693.c:121:8: warning: Excessive padding in 'struct max77693_muic_irq' (8 padding bytes, where 0 is optimal).
Optimal fields order:
name,
irq,
virq,
consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
struct max77693_muic_irq {
~~~~~~~^~~~~~~~~~~~~~~~~~~
drivers/extcon/extcon-max77693.c:121:8: note: Excessive padding in 'struct max77693_muic_irq' (8 padding bytes, where 0 is optimal). Optimal fields order: name, irq, virq, consider reordering the fields or adding explicit padding members
struct max77693_muic_irq {
~~~~~~~^~~~~~~~~~~~~~~~~~~
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
drivers/video/fbdev/hgafb.c:301:21: warning: Value stored to 'q_save' is never read [clang-analyzer-deadcode.DeadStores]
p_save = readw(p); q_save = readw(q);
^
drivers/video/fbdev/hgafb.c:301:21: note: Value stored to 'q_save' is never read
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
vim +587 drivers/media/i2c/ov5648.c
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 575
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 576 /*
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 577 * General formulas for (array-centered) mode calculation:
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 578 * - photo_array_width = 2624
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 579 * - crop_start_x = (photo_array_width - output_size_x) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 580 * - crop_end_x = crop_start_x + offset_x + output_size_x - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 581 *
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 582 * - photo_array_height = 1956
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 583 * - crop_start_y = (photo_array_height - output_size_y) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 584 * - crop_end_y = crop_start_y + offset_y + output_size_y - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 585 */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 586
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 @587 struct ov5648_mode {
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 588 unsigned int crop_start_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 589 unsigned int offset_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 590 unsigned int output_size_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 591 unsigned int crop_end_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 592 unsigned int hts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 593
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 594 unsigned int crop_start_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 595 unsigned int offset_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 596 unsigned int output_size_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 597 unsigned int crop_end_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 598 unsigned int vts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 599
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 600 bool binning_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 601 bool binning_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 602
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 603 unsigned int inc_x_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 604 unsigned int inc_x_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 605 unsigned int inc_y_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 606 unsigned int inc_y_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 607
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 608 /* 8-bit frame interval followed by 10-bit frame interval. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 609 struct v4l2_fract frame_interval[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 610
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 611 /* 8-bit config followed by 10-bit config. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 612 const struct ov5648_pll1_config *pll1_config[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 613 const struct ov5648_pll2_config *pll2_config;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 614
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 615 const struct ov5648_register_value *register_values;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 616 unsigned int register_values_count;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 617 };
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 618
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
@ 2021-11-12 12:42 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-11-12 12:42 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 18005 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Sakari Ailus <sakari.ailus@linux.intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5833291ab6de9c3e2374336b51c814e515e8f3a5
commit: e43ccb0a045f34838b786e8021dc4838b4af5c38 media: i2c: Add support for the OV5648 image sensor
date: 10 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 10 months ago
config: riscv-randconfig-c006-20211031 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d321548c3ce987f4f21350ba1c81fdb5d4354224)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e43ccb0a045f34838b786e8021dc4838b4af5c38
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e43ccb0a045f34838b786e8021dc4838b4af5c38
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
drivers/watchdog/pcwd_pci.c:696:2: note: Taking false branch
if (pci_enable_device(pdev)) {
^
drivers/watchdog/pcwd_pci.c:701:6: note: Assuming field 'start' is not equal to 0
if (pci_resource_start(pdev, 0) == 0x0000) {
^
include/linux/pci.h:1854:38: note: expanded from macro 'pci_resource_start'
#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
^
drivers/watchdog/pcwd_pci.c:701:2: note: Taking false branch
if (pci_resource_start(pdev, 0) == 0x0000) {
^
drivers/watchdog/pcwd_pci.c:707:2: note: Loop condition is false. Exiting loop
spin_lock_init(&pcipcwd_private.io_lock);
^
include/linux/spinlock.h:334:35: note: expanded from macro 'spin_lock_init'
# define spin_lock_init(lock) \
^
drivers/watchdog/pcwd_pci.c:711:6: note: Assuming the condition is false
if (pci_request_regions(pdev, WATCHDOG_NAME)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/watchdog/pcwd_pci.c:711:2: note: Taking false branch
if (pci_request_regions(pdev, WATCHDOG_NAME)) {
^
drivers/watchdog/pcwd_pci.c:731:2: note: Calling 'pcipcwd_show_card_info'
pcipcwd_show_card_info();
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/watchdog/pcwd_pci.c:226:32: note: 'fw_rev_minor' declared without an initial value
int got_fw_rev, fw_rev_major, fw_rev_minor;
^~~~~~~~~~~~
drivers/watchdog/pcwd_pci.c:230:15: note: Calling 'send_command'
got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/watchdog/pcwd_pci.c:158:6: note: Assuming 'debug' is < DEBUG
if (debug >= DEBUG)
^~~~~~~~~~~~~~
drivers/watchdog/pcwd_pci.c:158:2: note: Taking false branch
if (debug >= DEBUG)
^
drivers/watchdog/pcwd_pci.c:169:2: note: 1st function call argument is an uninitialized value
outb_p(*lsb, pcipcwd_private.io_addr + 4);
^ ~~~~
include/asm-generic/io.h:577:16: note: expanded from macro 'outb_p'
#define outb_p outb_p
^
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
drivers/staging/comedi/drivers/pcmmio.c:578:2: warning: Value stored to 'val' is never read [clang-analyzer-deadcode.DeadStores]
val |= inb(iobase + PCMMIO_AI_MSB_REG) << 8;
^
drivers/staging/comedi/drivers/pcmmio.c:578:2: note: Value stored to 'val' is never read
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
>> drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
Optimal fields order:
pll2_config,
register_values,
pll1_config,
crop_start_x,
offset_x,
output_size_x,
crop_end_x,
hts,
crop_start_y,
offset_y,
output_size_y,
crop_end_y,
vts,
inc_x_odd,
inc_x_even,
inc_y_odd,
inc_y_even,
register_values_count,
frame_interval,
binning_x,
binning_y,
consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
drivers/media/i2c/ov5648.c:587:8: note: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal). Optimal fields order: pll2_config, register_values, pll1_config, crop_start_x, offset_x, output_size_x, crop_end_x, hts, crop_start_y, offset_y, output_size_y, crop_end_y, vts, inc_x_odd, inc_x_even, inc_y_odd, inc_y_even, register_values_count, frame_interval, binning_x, binning_y, consider reordering the fields or adding explicit padding members
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
vim +587 drivers/media/i2c/ov5648.c
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 575
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 576 /*
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 577 * General formulas for (array-centered) mode calculation:
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 578 * - photo_array_width = 2624
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 579 * - crop_start_x = (photo_array_width - output_size_x) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 580 * - crop_end_x = crop_start_x + offset_x + output_size_x - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 581 *
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 582 * - photo_array_height = 1956
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 583 * - crop_start_y = (photo_array_height - output_size_y) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 584 * - crop_end_y = crop_start_y + offset_y + output_size_y - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 585 */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 586
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 @587 struct ov5648_mode {
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 588 unsigned int crop_start_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 589 unsigned int offset_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 590 unsigned int output_size_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 591 unsigned int crop_end_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 592 unsigned int hts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 593
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 594 unsigned int crop_start_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 595 unsigned int offset_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 596 unsigned int output_size_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 597 unsigned int crop_end_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 598 unsigned int vts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 599
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 600 bool binning_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 601 bool binning_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 602
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 603 unsigned int inc_x_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 604 unsigned int inc_x_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 605 unsigned int inc_y_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 606 unsigned int inc_y_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 607
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 608 /* 8-bit frame interval followed by 10-bit frame interval. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 609 struct v4l2_fract frame_interval[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 610
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 611 /* 8-bit config followed by 10-bit config. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 612 const struct ov5648_pll1_config *pll1_config[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 613 const struct ov5648_pll2_config *pll2_config;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 614
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 615 const struct ov5648_register_value *register_values;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 616 unsigned int register_values_count;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 617 };
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 618
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28811 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
@ 2021-08-22 12:34 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-08-22 12:34 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 16137 bytes --]
CC: clang-built-linux(a)googlegroups.com
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Sakari Ailus <sakari.ailus@linux.intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef
commit: e43ccb0a045f34838b786e8021dc4838b4af5c38 media: i2c: Add support for the OV5648 image sensor
date: 7 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 7 months ago
config: x86_64-randconfig-c007-20210821 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e43ccb0a045f34838b786e8021dc4838b4af5c38
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e43ccb0a045f34838b786e8021dc4838b4af5c38
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
net/socket.c:2856:9: note: Taking false branch
call = array_index_nospec(call, SYS_SENDMMSG + 1);
^
include/linux/nospec.h:58:2: note: expanded from macro 'array_index_nospec'
BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \
^
include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
net/socket.c:2856:9: note: Loop condition is false. Exiting loop
call = array_index_nospec(call, SYS_SENDMMSG + 1);
^
include/linux/nospec.h:58:2: note: expanded from macro 'array_index_nospec'
BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \
^
include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:304:2: note: expanded from macro '__compiletime_assert'
do { \
^
net/socket.c:2859:6: note: Assuming the condition is false
if (len > sizeof(a))
^~~~~~~~~~~~~~~
net/socket.c:2859:2: note: Taking false branch
if (len > sizeof(a))
^
net/socket.c:2863:6: note: Calling 'copy_from_user'
if (copy_from_user(a, args, len))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:191:6: note: Assuming the condition is true
if (likely(check_copy_size(to, n, false)))
^
include/linux/compiler.h:77:38: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^~~~
include/linux/uaccess.h:191:2: note: Taking false branch
if (likely(check_copy_size(to, n, false)))
^
include/linux/uaccess.h:193:2: note: Returning without writing to '*to'
return n;
^
include/linux/uaccess.h:193:2: note: Returning value (loaded from 'n'), which participates in a condition later
return n;
^~~~~~~~
net/socket.c:2863:6: note: Returning from 'copy_from_user'
if (copy_from_user(a, args, len))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/socket.c:2863:6: note: Assuming the condition is false
if (copy_from_user(a, args, len))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/socket.c:2863:2: note: Taking false branch
if (copy_from_user(a, args, len))
^
net/socket.c:2866:8: note: Calling 'audit_socketcall'
err = audit_socketcall(nargs[call] / sizeof(unsigned long), a);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/audit.h:611:2: note: Returning without writing to '*args'
return 0;
^
include/linux/audit.h:611:2: note: Returning zero, which participates in a condition later
return 0;
^~~~~~~~
net/socket.c:2866:8: note: Returning from 'audit_socketcall'
err = audit_socketcall(nargs[call] / sizeof(unsigned long), a);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/socket.c:2867:6: note: 'err' is 0
if (err)
^~~
net/socket.c:2867:2: note: Taking false branch
if (err)
^
net/socket.c:2870:5: note: Assigned value is garbage or undefined
a0 = a[0];
^ ~~~~
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
>> drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal).
Optimal fields order:
pll2_config,
register_values,
pll1_config,
crop_start_x,
offset_x,
output_size_x,
crop_end_x,
hts,
crop_start_y,
offset_y,
output_size_y,
crop_end_y,
vts,
inc_x_odd,
inc_x_even,
inc_y_odd,
inc_y_even,
register_values_count,
frame_interval,
binning_x,
binning_y,
consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
drivers/media/i2c/ov5648.c:587:8: note: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal). Optimal fields order: pll2_config, register_values, pll1_config, crop_start_x, offset_x, output_size_x, crop_end_x, hts, crop_start_y, offset_y, output_size_y, crop_end_y, vts, inc_x_odd, inc_x_even, inc_y_odd, inc_y_even, register_values_count, frame_interval, binning_x, binning_y, consider reordering the fields or adding explicit padding members
struct ov5648_mode {
~~~~~~~^~~~~~~~~~~~~
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
drivers/media/i2c/ov5695.c:1135:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = ov5695_write_reg(ov5695->client, OV5695_REG_DIGI_GAIN_L,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov5695.c:1135:3: note: Value stored to 'ret' is never read
ret = ov5695_write_reg(ov5695->client, OV5695_REG_DIGI_GAIN_L,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
drivers/media/i2c/ov772x.c:583:21: warning: Value stored to 'client' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct i2c_client *client = v4l2_get_subdevdata(sd);
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov772x.c:583:21: note: Value stored to 'client' during its initialization is never read
struct i2c_client *client = v4l2_get_subdevdata(sd);
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
11 warnings generated.
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
kernel/workqueue.c:147:8: warning: Excessive padding in 'struct worker_pool' (64 padding bytes, where 0 is optimal).
Optimal fields order:
nr_running,
cpu,
watchdog_ts,
manager,
detach_completion,
attrs,
worklist,
idle_list,
workers,
hash_node,
rcu,
lock,
idle_timer,
vim +587 drivers/media/i2c/ov5648.c
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 575
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 576 /*
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 577 * General formulas for (array-centered) mode calculation:
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 578 * - photo_array_width = 2624
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 579 * - crop_start_x = (photo_array_width - output_size_x) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 580 * - crop_end_x = crop_start_x + offset_x + output_size_x - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 581 *
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 582 * - photo_array_height = 1956
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 583 * - crop_start_y = (photo_array_height - output_size_y) / 2
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 584 * - crop_end_y = crop_start_y + offset_y + output_size_y - 1
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 585 */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 586
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 @587 struct ov5648_mode {
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 588 unsigned int crop_start_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 589 unsigned int offset_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 590 unsigned int output_size_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 591 unsigned int crop_end_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 592 unsigned int hts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 593
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 594 unsigned int crop_start_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 595 unsigned int offset_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 596 unsigned int output_size_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 597 unsigned int crop_end_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 598 unsigned int vts;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 599
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 600 bool binning_x;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 601 bool binning_y;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 602
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 603 unsigned int inc_x_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 604 unsigned int inc_x_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 605 unsigned int inc_y_odd;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 606 unsigned int inc_y_even;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 607
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 608 /* 8-bit frame interval followed by 10-bit frame interval. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 609 struct v4l2_fract frame_interval[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 610
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 611 /* 8-bit config followed by 10-bit config. */
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 612 const struct ov5648_pll1_config *pll1_config[2];
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 613 const struct ov5648_pll2_config *pll2_config;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 614
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 615 const struct ov5648_register_value *register_values;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 616 unsigned int register_values_count;
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 617 };
e43ccb0a045f34 Paul Kocialkowski 2020-12-31 618
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30296 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-18 14:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 18:55 drivers/media/i2c/ov5648.c:587:8: warning: Excessive padding in 'struct ov5648_mode' (10 padding bytes, where 2 is optimal) kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2021-12-18 14:14 kernel test robot
2021-11-12 12:42 kernel test robot
2021-08-22 12:34 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.