lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211220028.dGDnx2oE-lkp@intel.com>
Date:   Tue, 22 Nov 2022 00:16:29 +0800
From:   kernel test robot <lkp@...el.com>
To:     "Maciej W. Rozycki" <macro@...am.me.uk>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-kernel@...r.kernel.org, Palmer Dabbelt <palmer@...osinc.com>,
        Arnd Bergmann <arnd@...db.de>
Subject: drivers/scsi/qlogicfas408.c:111:4: warning: performing pointer
 arithmetic on a null pointer has undefined behavior

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   eb7081409f94a9a8608593d0fb63a1aa3d6f95d8
commit: 9cc205e3c17d5716da7ebb7fa0c985555e95d009 RISC-V: Make port I/O string accessors actually work
date:   6 weeks ago
config: riscv-randconfig-r022-20221120
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project bbe6bd724a6335e497c7edaed191d37a828d0390)
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=9cc205e3c17d5716da7ebb7fa0c985555e95d009
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9cc205e3c17d5716da7ebb7fa0c985555e95d009
        # 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 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

                                            ~~~~~~~~~~ ^
   In file included from drivers/scsi/qlogicfas408.c:43:
   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:11:
   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/qlogicfas408.c:43:
   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:11:
   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/qlogicfas408.c:43:
   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:11:
   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/qlogicfas408.c:43:
   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:11:
   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/qlogicfas408.c:43:
   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:11:
   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/qlogicfas408.c:43:
   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:11:
   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/qlogicfas408.c:111:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                           insl(qbase + 4, request, 32);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl'
   #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
                                            ~~~~~~~~~~ ^
   drivers/scsi/qlogicfas408.c:118:5: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                                   insl(qbase + 4, request, 21);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl'
   #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
                                            ~~~~~~~~~~ ^
   drivers/scsi/qlogicfas408.c:123:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                           insl(qbase + 4, request, 11);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/io.h:106:53: note: expanded from macro 'insl'
   #define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
                                            ~~~~~~~~~~ ^
   drivers/scsi/qlogicfas408.c:148:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                           outsl(qbase + 4, request, 32);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl'
   #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)
                                              ~~~~~~~~~~ ^
   drivers/scsi/qlogicfas408.c:154:5: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                                   outsl(qbase + 4, request, 21);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl'
   #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)
                                              ~~~~~~~~~~ ^
   drivers/scsi/qlogicfas408.c:159:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                           outsl(qbase + 4, request, 10);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/io.h:120:55: note: expanded from macro 'outsl'
   #define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)
                                              ~~~~~~~~~~ ^
   19 warnings generated.
--
   include/asm-generic/io.h:743:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           insb(addr, buffer, count);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/io.h:104:53: note: expanded from macro 'insb'
   #define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count)
                                            ~~~~~~~~~~ ^
   In file included from drivers/scsi/pcmcia/aha152x_core.c:3:
   In file included from drivers/scsi/aha152x.c:228:
   In file included from arch/riscv/include/asm/irq.h:10:
   In file included from include/linux/interrupt.h:11:
   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/pcmcia/aha152x_core.c:3:
   In file included from drivers/scsi/aha152x.c:228:
   In file included from arch/riscv/include/asm/irq.h:10:
   In file included from include/linux/interrupt.h:11:
   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/pcmcia/aha152x_core.c:3:
   In file included from drivers/scsi/aha152x.c:228:
   In file included from arch/riscv/include/asm/irq.h:10:
   In file included from include/linux/interrupt.h:11:
   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/pcmcia/aha152x_core.c:3:
   In file included from drivers/scsi/aha152x.c:228:
   In file included from arch/riscv/include/asm/irq.h:10:
   In file included from include/linux/interrupt.h:11:
   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/pcmcia/aha152x_core.c:3:
   In file included from drivers/scsi/aha152x.c:228:
   In file included from arch/riscv/include/asm/irq.h:10:
   In file included from include/linux/interrupt.h:11:
   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/pcmcia/aha152x_core.c:3:
   In file included from drivers/scsi/aha152x.c:228:
   In file included from arch/riscv/include/asm/irq.h:10:
   In file included from include/linux/interrupt.h:11:
   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/pcmcia/aha152x_core.c:3:
>> drivers/scsi/aha152x.c:2058:6: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                                           insw(DATAPORT, acp->ptr, data_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/pcmcia/aha152x_core.c:3:
   drivers/scsi/aha152x.c:2164:4: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                           outsw(DATAPORT, acp->ptr, data_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)
                                              ~~~~~~~~~~ ^
   15 warnings generated.


vim +111 drivers/scsi/qlogicfas408.c

^1da177e4c3f41 Linus Torvalds  2005-04-16   95  
^1da177e4c3f41 Linus Torvalds  2005-04-16   96  /*
^1da177e4c3f41 Linus Torvalds  2005-04-16   97   *	Do a pseudo-dma tranfer
^1da177e4c3f41 Linus Torvalds  2005-04-16   98   */
^1da177e4c3f41 Linus Torvalds  2005-04-16   99  
5751a9eaf18700 Hannes Reinecke 2021-04-27  100  static int ql_pdma(struct qlogicfas408_priv *priv, int phase, char *request,
5751a9eaf18700 Hannes Reinecke 2021-04-27  101  		   int reqlen)
^1da177e4c3f41 Linus Torvalds  2005-04-16  102  {
^1da177e4c3f41 Linus Torvalds  2005-04-16  103  	int j;
^1da177e4c3f41 Linus Torvalds  2005-04-16  104  	int qbase = priv->qbase;
^1da177e4c3f41 Linus Torvalds  2005-04-16  105  	j = 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16  106  	if (phase & 1) {	/* in */
^1da177e4c3f41 Linus Torvalds  2005-04-16  107  #if QL_TURBO_PDMA
^1da177e4c3f41 Linus Torvalds  2005-04-16  108  		rtrc(4)
^1da177e4c3f41 Linus Torvalds  2005-04-16  109  		/* empty fifo in large chunks */
^1da177e4c3f41 Linus Torvalds  2005-04-16  110  		if (reqlen >= 128 && (inb(qbase + 8) & 2)) {	/* full */
^1da177e4c3f41 Linus Torvalds  2005-04-16 @111  			insl(qbase + 4, request, 32);
^1da177e4c3f41 Linus Torvalds  2005-04-16  112  			reqlen -= 128;
^1da177e4c3f41 Linus Torvalds  2005-04-16  113  			request += 128;
^1da177e4c3f41 Linus Torvalds  2005-04-16  114  		}
^1da177e4c3f41 Linus Torvalds  2005-04-16  115  		while (reqlen >= 84 && !(j & 0xc0))	/* 2/3 */
^1da177e4c3f41 Linus Torvalds  2005-04-16  116  			if ((j = inb(qbase + 8)) & 4)
^1da177e4c3f41 Linus Torvalds  2005-04-16  117  			{
^1da177e4c3f41 Linus Torvalds  2005-04-16  118  				insl(qbase + 4, request, 21);
^1da177e4c3f41 Linus Torvalds  2005-04-16  119  				reqlen -= 84;
^1da177e4c3f41 Linus Torvalds  2005-04-16  120  				request += 84;
^1da177e4c3f41 Linus Torvalds  2005-04-16  121  			}
^1da177e4c3f41 Linus Torvalds  2005-04-16  122  		if (reqlen >= 44 && (inb(qbase + 8) & 8)) {	/* 1/3 */
^1da177e4c3f41 Linus Torvalds  2005-04-16  123  			insl(qbase + 4, request, 11);
^1da177e4c3f41 Linus Torvalds  2005-04-16  124  			reqlen -= 44;
^1da177e4c3f41 Linus Torvalds  2005-04-16  125  			request += 44;
^1da177e4c3f41 Linus Torvalds  2005-04-16  126  		}
^1da177e4c3f41 Linus Torvalds  2005-04-16  127  #endif
^1da177e4c3f41 Linus Torvalds  2005-04-16  128  		/* until both empty and int (or until reclen is 0) */
^1da177e4c3f41 Linus Torvalds  2005-04-16  129  		rtrc(7)
^1da177e4c3f41 Linus Torvalds  2005-04-16  130  		j = 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16  131  		while (reqlen && !((j & 0x10) && (j & 0xc0)))
^1da177e4c3f41 Linus Torvalds  2005-04-16  132  		{
^1da177e4c3f41 Linus Torvalds  2005-04-16  133  			/* while bytes to receive and not empty */
^1da177e4c3f41 Linus Torvalds  2005-04-16  134  			j &= 0xc0;
^1da177e4c3f41 Linus Torvalds  2005-04-16  135  			while (reqlen && !((j = inb(qbase + 8)) & 0x10))
^1da177e4c3f41 Linus Torvalds  2005-04-16  136  			{
^1da177e4c3f41 Linus Torvalds  2005-04-16  137  				*request++ = inb(qbase + 4);
^1da177e4c3f41 Linus Torvalds  2005-04-16  138  				reqlen--;
^1da177e4c3f41 Linus Torvalds  2005-04-16  139  			}
^1da177e4c3f41 Linus Torvalds  2005-04-16  140  			if (j & 0x10)
^1da177e4c3f41 Linus Torvalds  2005-04-16  141  				j = inb(qbase + 8);
^1da177e4c3f41 Linus Torvalds  2005-04-16  142  
^1da177e4c3f41 Linus Torvalds  2005-04-16  143  		}
^1da177e4c3f41 Linus Torvalds  2005-04-16  144  	} else {		/* out */
^1da177e4c3f41 Linus Torvalds  2005-04-16  145  #if QL_TURBO_PDMA
^1da177e4c3f41 Linus Torvalds  2005-04-16  146  		rtrc(4)
^1da177e4c3f41 Linus Torvalds  2005-04-16  147  		if (reqlen >= 128 && inb(qbase + 8) & 0x10) {	/* empty */
^1da177e4c3f41 Linus Torvalds  2005-04-16  148  			outsl(qbase + 4, request, 32);
^1da177e4c3f41 Linus Torvalds  2005-04-16  149  			reqlen -= 128;
^1da177e4c3f41 Linus Torvalds  2005-04-16  150  			request += 128;
^1da177e4c3f41 Linus Torvalds  2005-04-16  151  		}
^1da177e4c3f41 Linus Torvalds  2005-04-16  152  		while (reqlen >= 84 && !(j & 0xc0))	/* 1/3 */
^1da177e4c3f41 Linus Torvalds  2005-04-16  153  			if (!((j = inb(qbase + 8)) & 8)) {
^1da177e4c3f41 Linus Torvalds  2005-04-16  154  				outsl(qbase + 4, request, 21);
^1da177e4c3f41 Linus Torvalds  2005-04-16  155  				reqlen -= 84;
^1da177e4c3f41 Linus Torvalds  2005-04-16  156  				request += 84;
^1da177e4c3f41 Linus Torvalds  2005-04-16  157  			}
^1da177e4c3f41 Linus Torvalds  2005-04-16  158  		if (reqlen >= 40 && !(inb(qbase + 8) & 4)) {	/* 2/3 */
^1da177e4c3f41 Linus Torvalds  2005-04-16  159  			outsl(qbase + 4, request, 10);
^1da177e4c3f41 Linus Torvalds  2005-04-16  160  			reqlen -= 40;
^1da177e4c3f41 Linus Torvalds  2005-04-16  161  			request += 40;
^1da177e4c3f41 Linus Torvalds  2005-04-16  162  		}
^1da177e4c3f41 Linus Torvalds  2005-04-16  163  #endif
^1da177e4c3f41 Linus Torvalds  2005-04-16  164  		/* until full and int (or until reclen is 0) */
^1da177e4c3f41 Linus Torvalds  2005-04-16  165  		rtrc(7)
^1da177e4c3f41 Linus Torvalds  2005-04-16  166  		    j = 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16  167  		while (reqlen && !((j & 2) && (j & 0xc0))) {
^1da177e4c3f41 Linus Torvalds  2005-04-16  168  			/* while bytes to send and not full */
^1da177e4c3f41 Linus Torvalds  2005-04-16  169  			while (reqlen && !((j = inb(qbase + 8)) & 2))
^1da177e4c3f41 Linus Torvalds  2005-04-16  170  			{
^1da177e4c3f41 Linus Torvalds  2005-04-16  171  				outb(*request++, qbase + 4);
^1da177e4c3f41 Linus Torvalds  2005-04-16  172  				reqlen--;
^1da177e4c3f41 Linus Torvalds  2005-04-16  173  			}
^1da177e4c3f41 Linus Torvalds  2005-04-16  174  			if (j & 2)
^1da177e4c3f41 Linus Torvalds  2005-04-16  175  				j = inb(qbase + 8);
^1da177e4c3f41 Linus Torvalds  2005-04-16  176  		}
^1da177e4c3f41 Linus Torvalds  2005-04-16  177  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16  178  	/* maybe return reqlen */
^1da177e4c3f41 Linus Torvalds  2005-04-16  179  	return inb(qbase + 8) & 0xc0;
^1da177e4c3f41 Linus Torvalds  2005-04-16  180  }
^1da177e4c3f41 Linus Torvalds  2005-04-16  181  

:::::: The code at line 111 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@...970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@...970.osdl.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (157148 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ