[linux-next:master 7126/9113] fs/ntfs3/fsntfs.c:1874:9: warning: variable 'cnt' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   33e65b1f975cd2814fc0ea9617250fc4c1d7a553
commit: 6e5be40d32fb1907285277c02e74493ed43d77fe [7126/9113] fs/ntfs3: Add NTFS3 in fs/Kconfig and fs/Makefile
config: riscv-buildonly-randconfig-r005-20210820 (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
        # 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=6e5be40d32fb1907285277c02e74493ed43d77fe
        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 6e5be40d32fb1907285277c02e74493ed43d77fe
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from fs/ntfs3/fsntfs.c:8:
   In file included from include/linux/blkdev.h:18:
   In file included from include/linux/bio.h:8:
   In file included from include/linux/highmem.h:10:
   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:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from fs/ntfs3/fsntfs.c:8:
   In file included from include/linux/blkdev.h:18:
   In file included from include/linux/bio.h:8:
   In file included from include/linux/highmem.h:10:
   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:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from fs/ntfs3/fsntfs.c:8:
   In file included from include/linux/blkdev.h:18:
   In file included from include/linux/bio.h:8:
   In file included from include/linux/highmem.h:10:
   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:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
                                                     ~~~~~~~~~~ ^
>> fs/ntfs3/fsntfs.c:1874:9: warning: variable 'cnt' set but not used [-Wunused-but-set-variable]
           size_t cnt, off;
                  ^
   8 warnings generated.


vim +/cnt +1874 fs/ntfs3/fsntfs.c

82cae269cfa953 Konstantin Komarov 2021-08-13  1858  
82cae269cfa953 Konstantin Komarov 2021-08-13  1859  /*
82cae269cfa953 Konstantin Komarov 2021-08-13  1860   * ntfs_security_init
82cae269cfa953 Konstantin Komarov 2021-08-13  1861   *
82cae269cfa953 Konstantin Komarov 2021-08-13  1862   * loads and parse $Secure
82cae269cfa953 Konstantin Komarov 2021-08-13  1863   */
82cae269cfa953 Konstantin Komarov 2021-08-13  1864  int ntfs_security_init(struct ntfs_sb_info *sbi)
82cae269cfa953 Konstantin Komarov 2021-08-13  1865  {
82cae269cfa953 Konstantin Komarov 2021-08-13  1866  	int err;
82cae269cfa953 Konstantin Komarov 2021-08-13  1867  	struct super_block *sb = sbi->sb;
82cae269cfa953 Konstantin Komarov 2021-08-13  1868  	struct inode *inode;
82cae269cfa953 Konstantin Komarov 2021-08-13  1869  	struct ntfs_inode *ni;
82cae269cfa953 Konstantin Komarov 2021-08-13  1870  	struct MFT_REF ref;
82cae269cfa953 Konstantin Komarov 2021-08-13  1871  	struct ATTRIB *attr;
82cae269cfa953 Konstantin Komarov 2021-08-13  1872  	struct ATTR_LIST_ENTRY *le;
82cae269cfa953 Konstantin Komarov 2021-08-13  1873  	u64 sds_size;
82cae269cfa953 Konstantin Komarov 2021-08-13 @1874  	size_t cnt, off;
82cae269cfa953 Konstantin Komarov 2021-08-13  1875  	struct NTFS_DE *ne;
82cae269cfa953 Konstantin Komarov 2021-08-13  1876  	struct NTFS_DE_SII *sii_e;
82cae269cfa953 Konstantin Komarov 2021-08-13  1877  	struct ntfs_fnd *fnd_sii = NULL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1878  	const struct INDEX_ROOT *root_sii;
82cae269cfa953 Konstantin Komarov 2021-08-13  1879  	const struct INDEX_ROOT *root_sdh;
82cae269cfa953 Konstantin Komarov 2021-08-13  1880  	struct ntfs_index *indx_sdh = &sbi->security.index_sdh;
82cae269cfa953 Konstantin Komarov 2021-08-13  1881  	struct ntfs_index *indx_sii = &sbi->security.index_sii;
82cae269cfa953 Konstantin Komarov 2021-08-13  1882  
82cae269cfa953 Konstantin Komarov 2021-08-13  1883  	ref.low = cpu_to_le32(MFT_REC_SECURE);
82cae269cfa953 Konstantin Komarov 2021-08-13  1884  	ref.high = 0;
82cae269cfa953 Konstantin Komarov 2021-08-13  1885  	ref.seq = cpu_to_le16(MFT_REC_SECURE);
82cae269cfa953 Konstantin Komarov 2021-08-13  1886  
82cae269cfa953 Konstantin Komarov 2021-08-13  1887  	inode = ntfs_iget5(sb, &ref, &NAME_SECURE);
82cae269cfa953 Konstantin Komarov 2021-08-13  1888  	if (IS_ERR(inode)) {
82cae269cfa953 Konstantin Komarov 2021-08-13  1889  		err = PTR_ERR(inode);
82cae269cfa953 Konstantin Komarov 2021-08-13  1890  		ntfs_err(sb, "Failed to load $Secure.");
82cae269cfa953 Konstantin Komarov 2021-08-13  1891  		inode = NULL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1892  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1893  	}
82cae269cfa953 Konstantin Komarov 2021-08-13  1894  
82cae269cfa953 Konstantin Komarov 2021-08-13  1895  	ni = ntfs_i(inode);
82cae269cfa953 Konstantin Komarov 2021-08-13  1896  
82cae269cfa953 Konstantin Komarov 2021-08-13  1897  	le = NULL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1898  
82cae269cfa953 Konstantin Komarov 2021-08-13  1899  	attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SDH_NAME,
82cae269cfa953 Konstantin Komarov 2021-08-13  1900  			    ARRAY_SIZE(SDH_NAME), NULL, NULL);
82cae269cfa953 Konstantin Komarov 2021-08-13  1901  	if (!attr) {
82cae269cfa953 Konstantin Komarov 2021-08-13  1902  		err = -EINVAL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1903  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1904  	}
82cae269cfa953 Konstantin Komarov 2021-08-13  1905  
82cae269cfa953 Konstantin Komarov 2021-08-13  1906  	root_sdh = resident_data(attr);
82cae269cfa953 Konstantin Komarov 2021-08-13  1907  	if (root_sdh->type != ATTR_ZERO ||
82cae269cfa953 Konstantin Komarov 2021-08-13  1908  	    root_sdh->rule != NTFS_COLLATION_TYPE_SECURITY_HASH) {
82cae269cfa953 Konstantin Komarov 2021-08-13  1909  		err = -EINVAL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1910  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1911  	}
82cae269cfa953 Konstantin Komarov 2021-08-13  1912  
82cae269cfa953 Konstantin Komarov 2021-08-13  1913  	err = indx_init(indx_sdh, sbi, attr, INDEX_MUTEX_SDH);
82cae269cfa953 Konstantin Komarov 2021-08-13  1914  	if (err)
82cae269cfa953 Konstantin Komarov 2021-08-13  1915  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1916  
82cae269cfa953 Konstantin Komarov 2021-08-13  1917  	attr = ni_find_attr(ni, attr, &le, ATTR_ROOT, SII_NAME,
82cae269cfa953 Konstantin Komarov 2021-08-13  1918  			    ARRAY_SIZE(SII_NAME), NULL, NULL);
82cae269cfa953 Konstantin Komarov 2021-08-13  1919  	if (!attr) {
82cae269cfa953 Konstantin Komarov 2021-08-13  1920  		err = -EINVAL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1921  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1922  	}
82cae269cfa953 Konstantin Komarov 2021-08-13  1923  
82cae269cfa953 Konstantin Komarov 2021-08-13  1924  	root_sii = resident_data(attr);
82cae269cfa953 Konstantin Komarov 2021-08-13  1925  	if (root_sii->type != ATTR_ZERO ||
82cae269cfa953 Konstantin Komarov 2021-08-13  1926  	    root_sii->rule != NTFS_COLLATION_TYPE_UINT) {
82cae269cfa953 Konstantin Komarov 2021-08-13  1927  		err = -EINVAL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1928  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1929  	}
82cae269cfa953 Konstantin Komarov 2021-08-13  1930  
82cae269cfa953 Konstantin Komarov 2021-08-13  1931  	err = indx_init(indx_sii, sbi, attr, INDEX_MUTEX_SII);
82cae269cfa953 Konstantin Komarov 2021-08-13  1932  	if (err)
82cae269cfa953 Konstantin Komarov 2021-08-13  1933  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1934  
82cae269cfa953 Konstantin Komarov 2021-08-13  1935  	fnd_sii = fnd_get();
82cae269cfa953 Konstantin Komarov 2021-08-13  1936  	if (!fnd_sii) {
82cae269cfa953 Konstantin Komarov 2021-08-13  1937  		err = -ENOMEM;
82cae269cfa953 Konstantin Komarov 2021-08-13  1938  		goto out;
82cae269cfa953 Konstantin Komarov 2021-08-13  1939  	}
82cae269cfa953 Konstantin Komarov 2021-08-13  1940  
82cae269cfa953 Konstantin Komarov 2021-08-13  1941  	sds_size = inode->i_size;
82cae269cfa953 Konstantin Komarov 2021-08-13  1942  
82cae269cfa953 Konstantin Komarov 2021-08-13  1943  	/* Find the last valid Id */
82cae269cfa953 Konstantin Komarov 2021-08-13  1944  	sbi->security.next_id = SECURITY_ID_FIRST;
82cae269cfa953 Konstantin Komarov 2021-08-13  1945  	/* Always write new security at the end of bucket */
82cae269cfa953 Konstantin Komarov 2021-08-13  1946  	sbi->security.next_off =
82cae269cfa953 Konstantin Komarov 2021-08-13  1947  		Quad2Align(sds_size - SecurityDescriptorsBlockSize);
82cae269cfa953 Konstantin Komarov 2021-08-13  1948  
82cae269cfa953 Konstantin Komarov 2021-08-13  1949  	cnt = 0;
82cae269cfa953 Konstantin Komarov 2021-08-13  1950  	off = 0;
82cae269cfa953 Konstantin Komarov 2021-08-13  1951  	ne = NULL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1952  
82cae269cfa953 Konstantin Komarov 2021-08-13  1953  	for (;;) {
82cae269cfa953 Konstantin Komarov 2021-08-13  1954  		u32 next_id;
82cae269cfa953 Konstantin Komarov 2021-08-13  1955  
82cae269cfa953 Konstantin Komarov 2021-08-13  1956  		err = indx_find_raw(indx_sii, ni, root_sii, &ne, &off, fnd_sii);
82cae269cfa953 Konstantin Komarov 2021-08-13  1957  		if (err || !ne)
82cae269cfa953 Konstantin Komarov 2021-08-13  1958  			break;
82cae269cfa953 Konstantin Komarov 2021-08-13  1959  
82cae269cfa953 Konstantin Komarov 2021-08-13  1960  		sii_e = (struct NTFS_DE_SII *)ne;
82cae269cfa953 Konstantin Komarov 2021-08-13  1961  		if (le16_to_cpu(ne->view.data_size) < SIZEOF_SECURITY_HDR)
82cae269cfa953 Konstantin Komarov 2021-08-13  1962  			continue;
82cae269cfa953 Konstantin Komarov 2021-08-13  1963  
82cae269cfa953 Konstantin Komarov 2021-08-13  1964  		next_id = le32_to_cpu(sii_e->sec_id) + 1;
82cae269cfa953 Konstantin Komarov 2021-08-13  1965  		if (next_id >= sbi->security.next_id)
82cae269cfa953 Konstantin Komarov 2021-08-13  1966  			sbi->security.next_id = next_id;
82cae269cfa953 Konstantin Komarov 2021-08-13  1967  
82cae269cfa953 Konstantin Komarov 2021-08-13  1968  		cnt += 1;
82cae269cfa953 Konstantin Komarov 2021-08-13  1969  	}
82cae269cfa953 Konstantin Komarov 2021-08-13  1970  
82cae269cfa953 Konstantin Komarov 2021-08-13  1971  	sbi->security.ni = ni;
82cae269cfa953 Konstantin Komarov 2021-08-13  1972  	inode = NULL;
82cae269cfa953 Konstantin Komarov 2021-08-13  1973  out:
82cae269cfa953 Konstantin Komarov 2021-08-13  1974  	iput(inode);
82cae269cfa953 Konstantin Komarov 2021-08-13  1975  	fnd_put(fnd_sii);
82cae269cfa953 Konstantin Komarov 2021-08-13  1976  
82cae269cfa953 Konstantin Komarov 2021-08-13  1977  	return err;
82cae269cfa953 Konstantin Komarov 2021-08-13  1978  }
82cae269cfa953 Konstantin Komarov 2021-08-13  1979  

:::::: The code at line 1874 was first introduced by commit
:::::: 82cae269cfa953032fbb8980a7d554d60fb00b17 fs/ntfs3: Add initialization of super block

:::::: TO: Konstantin Komarov <almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx>
:::::: CC: Konstantin Komarov <almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux