From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49C2BC7EE22 for ; Tue, 9 May 2023 19:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234534AbjEITRj (ORCPT ); Tue, 9 May 2023 15:17:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjEITRg (ORCPT ); Tue, 9 May 2023 15:17:36 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08944215 for ; Tue, 9 May 2023 12:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683659853; x=1715195853; h=date:from:to:cc:subject:message-id:mime-version; bh=XPmv6AlcWeZDj2HAcLYuAIFurhPpqhljgSDmDA9hqh0=; b=OvdCZmIbd2JmAqJsD5jfQtU8lFj5I+ofzOVuFHk9XjscTPog3Moj+zDa C0qxb5UP8mq6ChguLVZpkj89oijrHlZbAGdTRjBauCHRuR5ScxdNnRU2p VDHYQ0WYv60V6yIWBbCS0kGMBnpHErO8iRyWv8dMwLlxJdAXpwAd+3Cml aYLPJnZJEVLnx/IWKAmI9jWn1Spra0dhDm+Q0guaatxsRZ2KzPJQaPLHh ZVTvCdBnYIVfpqhHIfCxz2jltnJitJLfy8kpWCFAh7GKl2e2my7qcedrK PKWZiLub4tsMYZljKZklfAh51cCyOFqsoIs74HT0G/7HIQRNxQszlJgia g==; X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="353095704" X-IronPort-AV: E=Sophos;i="5.99,262,1677571200"; d="scan'208";a="353095704" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2023 12:17:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="945413474" X-IronPort-AV: E=Sophos;i="5.99,262,1677571200"; d="scan'208";a="945413474" Received: from lkp-server01.sh.intel.com (HELO dea6d5a4f140) ([10.239.97.150]) by fmsmga006.fm.intel.com with ESMTP; 09 May 2023 12:17:30 -0700 Received: from kbuild by dea6d5a4f140 with local (Exim 4.96) (envelope-from ) id 1pwSq1-0002QW-1X; Tue, 09 May 2023 19:17:29 +0000 Date: Wed, 10 May 2023 03:17:19 +0800 From: kernel test robot To: Yimin Gu Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Palmer Dabbelt , Jesse Taube , Damien Le Moal , Conor Dooley Subject: drivers/scsi/ppa.c:307:4: warning: performing pointer arithmetic on a null pointer has undefined behavior Message-ID: <202305100328.UfvAhADW-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yimin, FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1dc3731daf1f350cfd631b5559aac865ab2fbb4c commit: b5e2c507b06c9d36411845149162a804ae7b04a9 riscv: Kconfig: Allow RV32 to build with no MMU date: 6 weeks ago config: riscv-randconfig-r013-20230509 (https://download.01.org/0day-ci/archive/20230510/202305100328.UfvAhADW-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b0fb98227c90adf2536c9ad644a74d5e92961111) 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-riscv-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b5e2c507b06c9d36411845149162a804ae7b04a9 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout b5e2c507b06c9d36411845149162a804ae7b04a9 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202305100328.UfvAhADW-lkp@intel.com/ All warnings (new ones prefixed by >>): ~~~~~~~~~~ ^ In file included from drivers/scsi/ppa.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:751:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insw(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:105:53: note: expanded from macro 'insw' #define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/ppa.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:759:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insl(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl' #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/ppa.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:768:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsb(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:118:55: note: expanded from macro 'outsb' #define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/ppa.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:777:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsw(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:119:55: note: expanded from macro 'outsw' #define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/ppa.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:786:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsl(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl' #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/ppa.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:1134:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port; ~~~~~~~~~~ ^ >> drivers/scsi/ppa.c:307:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsw(ppb + 4, buffer, len >> 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:119:55: note: expanded from macro 'outsw' #define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ drivers/scsi/ppa.c:313:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsb(ppb + 4, buffer, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:118:55: note: expanded from macro 'outsb' #define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ drivers/scsi/ppa.c:360:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insw(ppb + 4, buffer, len >> 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:105:53: note: expanded from macro 'insw' #define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ drivers/scsi/ppa.c:366:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insb(ppb + 4, buffer, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:104:53: note: expanded from macro 'insb' #define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ 17 warnings generated. -- ~~~~~~~~~~ ^ In file included from drivers/scsi/imm.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:751:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insw(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:105:53: note: expanded from macro 'insw' #define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/imm.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:759:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insl(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl' #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/imm.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:768:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsb(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:118:55: note: expanded from macro 'outsb' #define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/imm.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:777:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsw(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:119:55: note: expanded from macro 'outsw' #define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/imm.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:786:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsl(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl' #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/imm.c:15: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:1134:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port; ~~~~~~~~~~ ^ >> drivers/scsi/imm.c:371:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsw(ppb + 4, buffer, len >> 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:119:55: note: expanded from macro 'outsw' #define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ drivers/scsi/imm.c:377:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsb(ppb + 4, buffer, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:118:55: note: expanded from macro 'outsb' #define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ drivers/scsi/imm.c:431:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insw(ppb + 4, buffer, len >> 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:105:53: note: expanded from macro 'insw' #define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ drivers/scsi/imm.c:437:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insb(ppb + 4, buffer, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:104:53: note: expanded from macro 'insb' #define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ 17 warnings generated. -- In file included from drivers/scsi/nsp32.c:23: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:751:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insw(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:105:53: note: expanded from macro 'insw' #define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/nsp32.c:23: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:759:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insl(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl' #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/nsp32.c:23: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:768:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsb(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:118:55: note: expanded from macro 'outsb' #define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/nsp32.c:23: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:777:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsw(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:119:55: note: expanded from macro 'outsw' #define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/nsp32.c:23: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:786:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsl(addr, buffer, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl' #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/nsp32.c:23: In file included from include/linux/blkdev.h:9: 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/riscv/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/riscv/include/asm/io.h:136: include/asm-generic/io.h:1134:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port; ~~~~~~~~~~ ^ In file included from drivers/scsi/nsp32.c:279: >> drivers/scsi/nsp32_io.h:233:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] insl(base + reg, buf, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl' #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ In file included from drivers/scsi/nsp32.c:279: drivers/scsi/nsp32_io.h:248:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] outsl(base + reg, buf, count); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl' #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count) ~~~~~~~~~~ ^ 15 warnings generated. vim +307 drivers/scsi/ppa.c ^1da177e4c3f41 Linus Torvalds 2005-04-16 281 ^1da177e4c3f41 Linus Torvalds 2005-04-16 282 static int ppa_out(ppa_struct *dev, char *buffer, int len) ^1da177e4c3f41 Linus Torvalds 2005-04-16 283 { ^1da177e4c3f41 Linus Torvalds 2005-04-16 284 int r; ^1da177e4c3f41 Linus Torvalds 2005-04-16 285 unsigned short ppb = dev->base; ^1da177e4c3f41 Linus Torvalds 2005-04-16 286 ^1da177e4c3f41 Linus Torvalds 2005-04-16 287 r = ppa_wait(dev); ^1da177e4c3f41 Linus Torvalds 2005-04-16 288 ^1da177e4c3f41 Linus Torvalds 2005-04-16 289 if ((r & 0x50) != 0x40) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 290 ppa_fail(dev, DID_ERROR); ^1da177e4c3f41 Linus Torvalds 2005-04-16 291 return 0; ^1da177e4c3f41 Linus Torvalds 2005-04-16 292 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 293 switch (dev->mode) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 294 case PPA_NIBBLE: ^1da177e4c3f41 Linus Torvalds 2005-04-16 295 case PPA_PS2: ^1da177e4c3f41 Linus Torvalds 2005-04-16 296 /* 8 bit output, with a loop */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 297 r = ppa_byte_out(ppb, buffer, len); ^1da177e4c3f41 Linus Torvalds 2005-04-16 298 break; ^1da177e4c3f41 Linus Torvalds 2005-04-16 299 ^1da177e4c3f41 Linus Torvalds 2005-04-16 300 case PPA_EPP_32: ^1da177e4c3f41 Linus Torvalds 2005-04-16 301 case PPA_EPP_16: ^1da177e4c3f41 Linus Torvalds 2005-04-16 302 case PPA_EPP_8: ^1da177e4c3f41 Linus Torvalds 2005-04-16 303 epp_reset(ppb); ^1da177e4c3f41 Linus Torvalds 2005-04-16 304 w_ctr(ppb, 0x4); ^1da177e4c3f41 Linus Torvalds 2005-04-16 305 #ifdef CONFIG_SCSI_IZIP_EPP16 ^1da177e4c3f41 Linus Torvalds 2005-04-16 306 if (!(((long) buffer | len) & 0x01)) ^1da177e4c3f41 Linus Torvalds 2005-04-16 @307 outsw(ppb + 4, buffer, len >> 1); ^1da177e4c3f41 Linus Torvalds 2005-04-16 308 #else ^1da177e4c3f41 Linus Torvalds 2005-04-16 309 if (!(((long) buffer | len) & 0x03)) ^1da177e4c3f41 Linus Torvalds 2005-04-16 310 outsl(ppb + 4, buffer, len >> 2); ^1da177e4c3f41 Linus Torvalds 2005-04-16 311 #endif ^1da177e4c3f41 Linus Torvalds 2005-04-16 312 else ^1da177e4c3f41 Linus Torvalds 2005-04-16 313 outsb(ppb + 4, buffer, len); ^1da177e4c3f41 Linus Torvalds 2005-04-16 314 w_ctr(ppb, 0xc); ^1da177e4c3f41 Linus Torvalds 2005-04-16 315 r = !(r_str(ppb) & 0x01); ^1da177e4c3f41 Linus Torvalds 2005-04-16 316 w_ctr(ppb, 0xc); ^1da177e4c3f41 Linus Torvalds 2005-04-16 317 ecp_sync(dev); ^1da177e4c3f41 Linus Torvalds 2005-04-16 318 break; ^1da177e4c3f41 Linus Torvalds 2005-04-16 319 ^1da177e4c3f41 Linus Torvalds 2005-04-16 320 default: cebadc5c97547a Alan Cox 2007-07-09 321 printk(KERN_ERR "PPA: bug in ppa_out()\n"); ^1da177e4c3f41 Linus Torvalds 2005-04-16 322 r = 0; ^1da177e4c3f41 Linus Torvalds 2005-04-16 323 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 324 return r; ^1da177e4c3f41 Linus Torvalds 2005-04-16 325 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 326 :::::: The code at line 307 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests