From: kernel test robot <lkp@intel.com>
To: Jean-Francois Bortolotti <jeff@borto.fr>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Hector Martin <marcan@marcan.st>
Subject: [asahilinux:bits/120-spmi 1/4] drivers/spmi/spmi-apple-controller.c:81 spmi_read_cmd() warn: inconsistent indenting
Date: Mon, 8 Aug 2022 02:46:06 +0800 [thread overview]
Message-ID: <202208080200.DoRX2CoQ-lkp@intel.com> (raw)
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@intel.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
reply other threads:[~2022-08-07 18:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202208080200.DoRX2CoQ-lkp@intel.com \
--to=lkp@intel.com \
--cc=jeff@borto.fr \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcan@marcan.st \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.