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: <202203221449.ZauPHH0U-lkp@intel.com>
Date:   Tue, 22 Mar 2022 14:31:26 +0800
From:   kernel test robot <lkp@...el.com>
To:     Johannes Holland <johannes.holland@...ineon.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Jarkko Sakkinen <jarkko@...nel.org>
Subject: [jarkko-tpmdd:master 27/27]
 drivers/char/tpm/tpm_tis_synquacer.c:89:26: warning: passing argument 1 of
 'writeb' makes integer from pointer without a cast

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git master
head:   a536629ef32d127d26f3886f1fd480708fd5ac20
commit: a536629ef32d127d26f3886f1fd480708fd5ac20 [27/27] tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20220322/202203221449.ZauPHH0U-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 11.2.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/commit/?id=a536629ef32d127d26f3886f1fd480708fd5ac20
        git remote add jarkko-tpmdd git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git
        git fetch --no-tags jarkko-tpmdd master
        git checkout a536629ef32d127d26f3886f1fd480708fd5ac20
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc SHELL=/bin/bash drivers/char/tpm/

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

All warnings (new ones prefixed by >>):

   drivers/char/tpm/tpm_tis_synquacer.c: In function 'tpm_tis_synquacer_read_bytes':
   drivers/char/tpm/tpm_tis_synquacer.c:45:13: warning: unused variable 'result32' [-Wunused-variable]
      45 |         u32 result32;
         |             ^~~~~~~~
   drivers/char/tpm/tpm_tis_synquacer.c:44:13: warning: unused variable 'result16' [-Wunused-variable]
      44 |         u16 result16;
         |             ^~~~~~~~
   drivers/char/tpm/tpm_tis_synquacer.c:43:16: warning: unused variable 'result_le32' [-Wunused-variable]
      43 |         __le32 result_le32;
         |                ^~~~~~~~~~~
   drivers/char/tpm/tpm_tis_synquacer.c:42:16: warning: unused variable 'result_le16' [-Wunused-variable]
      42 |         __le16 result_le16;
         |                ^~~~~~~~~~~
   drivers/char/tpm/tpm_tis_synquacer.c: In function 'tpm_tis_synquacer_write_bytes':
>> drivers/char/tpm/tpm_tis_synquacer.c:89:26: warning: passing argument 1 of 'writeb' makes integer from pointer without a cast [-Wint-conversion]
      89 |                 iowrite8(&value[3], phy->iobase + addr + 3);
         |                          ^~~~~~~~~
         |                          |
         |                          const u8 * {aka const unsigned char *}
   In file included from arch/sparc/include/asm/io.h:5,
                    from include/linux/io.h:13,
                    from drivers/char/tpm/tpm.h:26,
                    from drivers/char/tpm/tpm_tis_synquacer.c:14:
   arch/sparc/include/asm/io_64.h:157:30: note: expected 'u8' {aka 'unsigned char'} but argument is of type 'const u8 *' {aka 'const unsigned char *'}
     157 | static inline void writeb(u8 b, volatile void __iomem *addr)
         |                           ~~~^
   drivers/char/tpm/tpm_tis_synquacer.c:90:26: warning: passing argument 1 of 'writeb' makes integer from pointer without a cast [-Wint-conversion]
      90 |                 iowrite8(&value[2], phy->iobase + addr + 2);
         |                          ^~~~~~~~~
         |                          |
         |                          const u8 * {aka const unsigned char *}
   In file included from arch/sparc/include/asm/io.h:5,
                    from include/linux/io.h:13,
                    from drivers/char/tpm/tpm.h:26,
                    from drivers/char/tpm/tpm_tis_synquacer.c:14:
   arch/sparc/include/asm/io_64.h:157:30: note: expected 'u8' {aka 'unsigned char'} but argument is of type 'const u8 *' {aka 'const unsigned char *'}
     157 | static inline void writeb(u8 b, volatile void __iomem *addr)
         |                           ~~~^
   drivers/char/tpm/tpm_tis_synquacer.c:91:26: warning: passing argument 1 of 'writeb' makes integer from pointer without a cast [-Wint-conversion]
      91 |                 iowrite8(&value[1], phy->iobase + addr + 1);
         |                          ^~~~~~~~~
         |                          |
         |                          const u8 * {aka const unsigned char *}
   In file included from arch/sparc/include/asm/io.h:5,
                    from include/linux/io.h:13,
                    from drivers/char/tpm/tpm.h:26,
                    from drivers/char/tpm/tpm_tis_synquacer.c:14:
   arch/sparc/include/asm/io_64.h:157:30: note: expected 'u8' {aka 'unsigned char'} but argument is of type 'const u8 *' {aka 'const unsigned char *'}
     157 | static inline void writeb(u8 b, volatile void __iomem *addr)
         |                           ~~~^
   drivers/char/tpm/tpm_tis_synquacer.c:92:26: warning: passing argument 1 of 'writeb' makes integer from pointer without a cast [-Wint-conversion]
      92 |                 iowrite8(&value[0], phy->iobase + addr);
         |                          ^~~~~~~~~
         |                          |
         |                          const u8 * {aka const unsigned char *}
   In file included from arch/sparc/include/asm/io.h:5,
                    from include/linux/io.h:13,
                    from drivers/char/tpm/tpm.h:26,
                    from drivers/char/tpm/tpm_tis_synquacer.c:14:
   arch/sparc/include/asm/io_64.h:157:30: note: expected 'u8' {aka 'unsigned char'} but argument is of type 'const u8 *' {aka 'const unsigned char *'}
     157 | static inline void writeb(u8 b, volatile void __iomem *addr)
         |                           ~~~^
   drivers/char/tpm/tpm_tis_synquacer.c:75:13: warning: unused variable 'result32' [-Wunused-variable]
      75 |         u32 result32;
         |             ^~~~~~~~
   drivers/char/tpm/tpm_tis_synquacer.c:74:13: warning: unused variable 'result16' [-Wunused-variable]
      74 |         u16 result16;
         |             ^~~~~~~~
   drivers/char/tpm/tpm_tis_synquacer.c:73:16: warning: unused variable 'result_le32' [-Wunused-variable]
      73 |         __le32 result_le32;
         |                ^~~~~~~~~~~
   drivers/char/tpm/tpm_tis_synquacer.c:72:16: warning: unused variable 'result_le16' [-Wunused-variable]
      72 |         __le16 result_le16;
         |                ^~~~~~~~~~~


vim +/writeb +89 drivers/char/tpm/tpm_tis_synquacer.c

    66	
    67	static int tpm_tis_synquacer_write_bytes(struct tpm_tis_data *data, u32 addr,
    68						 u16 len, const u8 *value,
    69						 enum tpm_tis_io_mode io_mode)
    70	{
    71		struct tpm_tis_synquacer_phy *phy = to_tpm_tis_tcg_phy(data);
    72		__le16 result_le16;
    73		__le32 result_le32;
    74		u16 result16;
    75		u32 result32;
    76	
    77		switch (io_mode) {
    78		case TPM_TIS_PHYS_8:
    79			while (len--)
    80				iowrite8(*value++, phy->iobase + addr);
    81			break;
    82		case TPM_TIS_PHYS_16:
    83			return -EINVAL;
    84		case TPM_TIS_PHYS_32:
    85			/*
    86			 * Due to the limitation of SPI controller on SynQuacer,
    87			 * 16/32 bits access must be done in byte-wise and descending order.
    88			 */
  > 89			iowrite8(&value[3], phy->iobase + addr + 3);
    90			iowrite8(&value[2], phy->iobase + addr + 2);
    91			iowrite8(&value[1], phy->iobase + addr + 1);
    92			iowrite8(&value[0], phy->iobase + addr);
    93			break;
    94		}
    95	
    96		return 0;
    97	}
    98	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ