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: <202208080200.DoRX2CoQ-lkp@intel.com>
Date:   Mon, 8 Aug 2022 02:46:06 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jean-Francois Bortolotti <jeff@...to.fr>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Hector Martin <marcan@...can.st>
Subject: [asahilinux:bits/120-spmi 1/4]
 drivers/spmi/spmi-apple-controller.c:81 spmi_read_cmd() warn: inconsistent
 indenting

tree:   https://github.com/AsahiLinux/linux bits/120-spmi
head:   0324791a3cdc3e93df57f6293e2cfaaadc264aeb
commit: 69860806b247b72cc354ca35ea147c2d1538ea85 [1/4] spmi: add a first basic spmi driver for Apple SoC
config: xtensa-randconfig-m031-20220803 (https://download.01.org/0day-ci/archive/20220808/202208080200.DoRX2CoQ-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 12.1.0

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

New smatch warnings:
drivers/spmi/spmi-apple-controller.c:81 spmi_read_cmd() warn: inconsistent indenting
drivers/spmi/spmi-apple-controller.c:97 spmi_write_cmd() warn: inconsistent indenting

Old smatch warnings:
drivers/spmi/spmi-apple-controller.c:83 spmi_read_cmd() warn: inconsistent indenting
drivers/spmi/spmi-apple-controller.c:86 spmi_read_cmd() warn: inconsistent indenting
drivers/spmi/spmi-apple-controller.c:90 spmi_read_cmd() warn: inconsistent indenting

vim +81 drivers/spmi/spmi-apple-controller.c

    47	
    48	static int spmi_read_cmd(struct spmi_controller *ctrl,
    49				 u8 opc, u8 slave_id, u16 slave_addr, u8 *__buf, size_t bc)
    50	{
    51		struct apple_spmi *spmi;
    52		u32 spmi_cmd = opc|slave_id<<8|slave_addr<<16|(bc-1)|(1<<15);
    53		u32 rsp;
    54		volatile u32 status;
    55		size_t len_to_read;
    56		u8 i;
    57	
    58		spmi = spmi_controller_get_drvdata(ctrl);
    59	
    60		write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
    61	
    62		/* Wait for Rx FIFO to have something */
    63		/* Quite ugly msleep, need to find a better way to do it */
    64		i=0;
    65		do {
    66			status=read_reg(spmi, SPMI_STATUS_REG);
    67			msleep(10);
    68			i+=1;
    69		} while ((status & SPMI_RX_FIFO_EMPTY) && i<5);
    70	
    71		if(i>=5){
    72			dev_err(&ctrl->dev,"spmi_read_cmd:took to long to get the status");
    73			return -1;
    74		}
    75	
    76		/* Read SPMI reply status */
    77		rsp=read_reg(spmi, SPMI_RSP_REG);
    78	
    79		len_to_read = 0;
    80		/* Read SPMI data reply */
  > 81	    while (!( status & SPMI_RX_FIFO_EMPTY ) && (len_to_read < bc )) {
    82	        rsp=read_reg(spmi, SPMI_RSP_REG);
    83			i=0;
    84			while ((len_to_read<bc)&&(i<4)) {
    85				__buf[len_to_read++]=((0xff<<(8*i))&rsp)>>(8*i);
    86				 i+=1;
    87			}
    88		}
    89	
    90		return 0;
    91	}
    92	
    93	static int spmi_write_cmd(struct spmi_controller *ctrl,
    94				  u8 opc, u8 slave_id, u16 slave_addr, const u8 *__buf, size_t bc)
    95	{
    96	    struct apple_spmi *spmi;
  > 97		u32 spmi_cmd = opc|slave_id<<8|slave_addr<<16|(bc-1)|(1<<15);
    98		volatile u32 rsp;
    99		size_t i=0,j;
   100	
   101		spmi = spmi_controller_get_drvdata(ctrl);
   102	
   103		write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
   104	
   105		while (i<bc) {
   106			j=0;
   107			spmi_cmd=0;
   108			while ((j<4)&(i<bc)) {
   109				spmi_cmd |= __buf[i++]<<(j++*8);
   110			}
   111			write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
   112		}
   113	
   114		/* Read SPMI reply status */
   115		/* do we need this while loop ?
   116			if yes what for ? */
   117		do {
   118			rsp=read_reg(spmi, SPMI_RSP_REG);
   119		} while (rsp==0);
   120	
   121		return 0;
   122	}
   123	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ