All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [linux-next:master 7181/8804] fs/fat/fat_test.c:23:8: warning: Excessive padding in 'struct fat_timestamp_testcase' (11 padding bytes, where 3 is optimal).
Date: Thu, 19 Aug 2021 10:49:45 +0800	[thread overview]
Message-ID: <202108191038.m196uAE1-lkp@intel.com> (raw)

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

CC: clang-built-linux(a)googlegroups.com
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: David Gow <davidgow@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: Brendan Higgins <brendanhiggins@google.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f26c3abc432a2026ba9ee7767061a1f88aead6ec
commit: b0d4adaf3b3c4402d9c3b6186e02aa1e4f7985cd [7181/8804] fat: Add KUnit tests for checksums and timestamps
:::::: branch date: 19 hours ago
:::::: commit date: 5 days ago
config: riscv-randconfig-c006-20210818 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
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/next/linux-next.git/commit/?id=b0d4adaf3b3c4402d9c3b6186e02aa1e4f7985cd
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout b0d4adaf3b3c4402d9c3b6186e02aa1e4f7985cd
        # 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/tty/serial/serial_core.c:2719:2: note: Returning from 'uart_get_info'
           uart_get_info(port, &tmp);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tty/serial/serial_core.c:2720:9: note: 3rd function call argument is an uninitialized value
           return sprintf(buf, "0x%lX\n", (unsigned long)tmp.iomem_base);
                  ^                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tty/serial/serial_core.c:2730:9: warning: 3rd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
           return sprintf(buf, "%d\n", tmp.iomem_reg_shift);
                  ^                    ~~~~~~~~~~~~~~~~~~~
   drivers/tty/serial/serial_core.c:2729:2: note: Calling 'uart_get_info'
           uart_get_info(port, &tmp);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tty/serial/serial_core.c:734:29: note: Left side of '&&' is false
           struct uart_state *state = container_of(port, struct uart_state, port);
                                      ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/tty/serial/serial_core.c:734:29: note: Taking false branch
           struct uart_state *state = container_of(port, struct uart_state, port);
                                      ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   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:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/tty/serial/serial_core.c:734:29: note: Loop condition is false.  Exiting loop
           struct uart_state *state = container_of(port, struct uart_state, port);
                                      ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   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:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/tty/serial/serial_core.c:744:6: note: Assuming 'uport' is null
           if (!uport)
               ^~~~~~
   drivers/tty/serial/serial_core.c:744:2: note: Taking true branch
           if (!uport)
           ^
   drivers/tty/serial/serial_core.c:745:3: note: Control jumps to line 768
                   goto out;
                   ^
   drivers/tty/serial/serial_core.c:769:2: note: Returning without writing to 'retinfo->iomem_reg_shift'
           return ret;
           ^
   drivers/tty/serial/serial_core.c:2729:2: note: Returning from 'uart_get_info'
           uart_get_info(port, &tmp);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tty/serial/serial_core.c:2730:9: note: 3rd function call argument is an uninitialized value
           return sprintf(buf, "%d\n", tmp.iomem_reg_shift);
                  ^                    ~~~~~~~~~~~~~~~~~~~
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
>> fs/fat/fat_test.c:23:8: warning: Excessive padding in 'struct fat_timestamp_testcase' (11 padding bytes, where 3 is optimal). 
   Optimal fields order: 
   ts, 
   name, 
   time_offset, 
   time, 
   date, 
   cs, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct fat_timestamp_testcase {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   fs/fat/fat_test.c:23:8: note: Excessive padding in 'struct fat_timestamp_testcase' (11 padding bytes, where 3 is optimal). Optimal fields order: ts, name, time_offset, time, date, cs, consider reordering the fields or adding explicit padding members
   struct fat_timestamp_testcase {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 4 warnings (4 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.
   fs/exfat/inode.c:148:3: warning: Value stored to 'clu_offset' is never read [clang-analyzer-deadcode.DeadStores]
                   clu_offset -= fclus;
                   ^             ~~~~~
   fs/exfat/inode.c:148:3: note: Value stored to 'clu_offset' is never read
                   clu_offset -= fclus;
                   ^             ~~~~~
   fs/exfat/inode.c:217:3: warning: Value stored to 'num_clusters' is never read [clang-analyzer-deadcode.DeadStores]
                   num_clusters += num_to_be_allocated;
                   ^               ~~~~~~~~~~~~~~~~~~~
   fs/exfat/inode.c:217:3: note: Value stored to 'num_clusters' is never read
                   num_clusters += num_to_be_allocated;
                   ^               ~~~~~~~~~~~~~~~~~~~
   Suppressed 4 warnings (4 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.
   Suppressed 4 warnings (4 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.
   fs/exfat/dir.c:92:22: warning: The result of the right shift is undefined because the right operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
           clu_offset = dentry >> dentries_per_clu_bits;
                               ^
   fs/exfat/dir.c:232:2: note: Taking false branch
           if (!dir_emit_dots(filp, ctx))
           ^
   fs/exfat/dir.c:235:6: note: Assuming field 'pos' is equal to ITER_POS_FILLED_DOTS
           if (ctx->pos == ITER_POS_FILLED_DOTS) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:235:2: note: Taking true branch
           if (ctx->pos == ITER_POS_FILLED_DOTS) {
           ^
   fs/exfat/dir.c:240:2: note: Taking false branch
           if (cpos & (DENTRY_SIZE - 1)) {
           ^
   fs/exfat/dir.c:247:6: note: 'err' is 0
           if (err)
               ^~~
   fs/exfat/dir.c:247:2: note: Taking false branch
           if (err)
           ^
   fs/exfat/dir.c:250:6: note: Assuming field 'flags' is not equal to ALLOC_NO_FAT_CHAIN
           if (ei->flags == ALLOC_NO_FAT_CHAIN && cpos >= i_size_read(inode))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:250:38: note: Left side of '&&' is false
           if (ei->flags == ALLOC_NO_FAT_CHAIN && cpos >= i_size_read(inode))
                                               ^
   fs/exfat/dir.c:253:8: note: Calling 'exfat_readdir'
           err = exfat_readdir(inode, &cpos, &de);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:78:6: note: Assuming field 'type' is equal to TYPE_DIR
           if (ei->type != TYPE_DIR)
               ^~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:78:2: note: Taking false branch
           if (ei->type != TYPE_DIR)
           ^
   fs/exfat/dir.c:81:6: note: Assuming the condition is true
           if (ei->entry == -1)
               ^~~~~~~~~~~~~~~
   fs/exfat/dir.c:81:2: note: Taking true branch
           if (ei->entry == -1)
           ^
   fs/exfat/dir.c:88:26: note: '?' condition is false
           dentries_per_clu_bits = ilog2(dentries_per_clu);
                                   ^
   include/linux/log2.h:158:2: note: expanded from macro 'ilog2'
           __builtin_constant_p(n) ?       \
           ^
   fs/exfat/dir.c:88:26: note: '?' condition is true
           dentries_per_clu_bits = ilog2(dentries_per_clu);
                                   ^
   include/linux/log2.h:161:2: note: expanded from macro 'ilog2'
           (sizeof(n) <= 4) ?              \
           ^
   fs/exfat/dir.c:88:26: note: Calling '__ilog2_u32'
           dentries_per_clu_bits = ilog2(dentries_per_clu);
                                   ^
   include/linux/log2.h:162:2: note: expanded from macro 'ilog2'
           __ilog2_u32(n) :                \
           ^~~~~~~~~~~~~~
   include/linux/log2.h:24:2: note: Returning the value -1
           return fls(n) - 1;
           ^~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:88:26: note: Returning from '__ilog2_u32'
           dentries_per_clu_bits = ilog2(dentries_per_clu);
                                   ^

vim +23 fs/fat/fat_test.c

b0d4adaf3b3c44 David Gow 2021-04-15  22  
b0d4adaf3b3c44 David Gow 2021-04-15 @23  struct fat_timestamp_testcase {
b0d4adaf3b3c44 David Gow 2021-04-15  24  	const char *name;
b0d4adaf3b3c44 David Gow 2021-04-15  25  	struct timespec64 ts;
b0d4adaf3b3c44 David Gow 2021-04-15  26  	__le16 time;
b0d4adaf3b3c44 David Gow 2021-04-15  27  	__le16 date;
b0d4adaf3b3c44 David Gow 2021-04-15  28  	u8 cs;
b0d4adaf3b3c44 David Gow 2021-04-15  29  	int time_offset;
b0d4adaf3b3c44 David Gow 2021-04-15  30  };
b0d4adaf3b3c44 David Gow 2021-04-15  31  

---
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: 32301 bytes --]

             reply	other threads:[~2021-08-19  2:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  2:49 kernel test robot [this message]
2021-08-19  8:48 ` [kbuild-all] [linux-next:master 7181/8804] fs/fat/fat_test.c:23:8: warning: Excessive padding in 'struct fat_timestamp_testcase' (11 padding bytes, where 3 is optimal) kernel test robot
2021-08-19  8:48   ` kernel test robot

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=202108191038.m196uAE1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 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.