public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [bvanassche:write-pipelining 9/19] drivers/scsi/sd_test.c:34:13: warning: stack frame size (2688) exceeds limit (1024) in 'test_sd_cmp_sector'
Date: Sat, 18 Nov 2023 18:48:43 +0800	[thread overview]
Message-ID: <202311181859.GE5EFaE5-lkp@intel.com> (raw)

tree:   https://github.com/bvanassche/linux write-pipelining
head:   f409a1d5e3ab8709f7ee3147de97200d455003e8
commit: 53da08715927f5be1d68ad383bb7a419c834ea47 [9/19] scsi: sd: Add a unit test for sd_cmp_sector()
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20231118/202311181859.GE5EFaE5-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231118/202311181859.GE5EFaE5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311181859.GE5EFaE5-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/scsi/sd.c:40:
   In file included from include/linux/bio.h:10:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:337:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/scsi/sd.c:40:
   In file included from include/linux/bio.h:10:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:337:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/scsi/sd.c:40:
   In file included from include/linux/bio.h:10:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:337:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   In file included from drivers/scsi/sd.c:4146:
>> drivers/scsi/sd_test.c:34:13: warning: stack frame size (2688) exceeds limit (1024) in 'test_sd_cmp_sector' [-Wframe-larger-than]
      34 | static void test_sd_cmp_sector(struct kunit *test)
         |             ^
   7 warnings generated.


vim +/test_sd_cmp_sector +34 drivers/scsi/sd_test.c

    30	
    31	/*
    32	 * Verify that sd_cmp_sector() does what it is expected to do.
    33	 */
  > 34	static void test_sd_cmp_sector(struct kunit *test)
    35	{
    36		struct request_queue *q1 __free(kfree) =
    37			ALLOC_Q(.limits.use_zone_write_lock = true);
    38		struct request_queue *q2 __free(kfree) =
    39			ALLOC_Q(.limits.use_zone_write_lock = false);
    40		struct rq_and_cmd *cmd1 __free(kfree) = ALLOC_CMD(.rq = {
    41									  .q = q1,
    42									  .__sector = 7,
    43								  });
    44		struct rq_and_cmd *cmd2 __free(kfree) = ALLOC_CMD(.rq = {
    45									  .q = q1,
    46									  .__sector = 5,
    47								  });
    48		struct rq_and_cmd *cmd3 __free(kfree) = ALLOC_CMD(.rq = {
    49									  .q = q2,
    50									  .__sector = 7,
    51								  });
    52		struct rq_and_cmd *cmd4 __free(kfree) = ALLOC_CMD(.rq = {
    53									  .q = q2,
    54									  .__sector = 5,
    55								  });
    56		LIST_HEAD(cmd_list);
    57	
    58		list_add_tail(&cmd1->cmd.eh_entry, &cmd_list);
    59		list_add_tail(&cmd2->cmd.eh_entry, &cmd_list);
    60		list_add_tail(&cmd3->cmd.eh_entry, &cmd_list);
    61		list_add_tail(&cmd4->cmd.eh_entry, &cmd_list);
    62		KUNIT_EXPECT_EQ(test, list_count_nodes(&cmd_list), 4);
    63		list_sort(NULL, &cmd_list, sd_cmp_sector);
    64		KUNIT_EXPECT_EQ(test, list_count_nodes(&cmd_list), 4);
    65		KUNIT_EXPECT_PTR_EQ(test, cmd_list.next, &cmd4->cmd.eh_entry);
    66		KUNIT_EXPECT_PTR_EQ(test, cmd_list.next->next, &cmd3->cmd.eh_entry);
    67		KUNIT_EXPECT_PTR_EQ(test, cmd_list.next->next->next,
    68				    &cmd1->cmd.eh_entry);
    69		KUNIT_EXPECT_PTR_EQ(test, cmd_list.next->next->next->next,
    70				    &cmd2->cmd.eh_entry);
    71	}
    72	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-11-18 10:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202311181859.GE5EFaE5-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bvanassche@acm.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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