[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49f9d3c8dc8882e36bb8785ac9d6b75e5f35d77b.camel@perches.com>
Date: Wed, 12 Aug 2020 09:17:47 -0700
From: Joe Perches <joe@...ches.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc: linuxarm@...wei.com, mauro.chehab@...wei.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH 10/44] staging: spmi: hisi-spmi-controller: do some code
cleanups
On Wed, 2020-08-12 at 17:56 +0200, Mauro Carvalho Chehab wrote:
> There are several minor things that can be cleanup in
> order to make this driver more prepared for leaving staging.
trivial style notes:
> diff --git a/drivers/staging/hikey9xx/hisi-spmi-controller.c b/drivers/staging/hikey9xx/hisi-spmi-controller.c
[]
> @@ -106,14 +83,13 @@ static int spmi_controller_wait_for_done(struct device *dev,
> struct spmi_controller_dev *ctrl_dev,
> void __iomem *base, u8 sid, u16 addr)
> {
> - u32 status = 0;
> u32 timeout = SPMI_CONTROLLER_TIMEOUT_US;
> - u32 offset;
> + u32 status, offset;
>
> offset = SPMI_APB_SPMI_STATUS_BASE_ADDR;
> offset += SPMI_CHANNEL_OFFSET * ctrl_dev->channel + SPMI_SLAVE_OFFSET * sid;
>
> - while (timeout--) {
> + do {
> status = readl(base + offset);
>
> if (status & SPMI_APB_TRANS_DONE) {
> @@ -126,21 +102,21 @@ static int spmi_controller_wait_for_done(struct device *dev,
> return 0;
> }
> udelay(1);
> - }
> + } while(timeout--);
Odd spacing.
Two spaces after close brace, none before open parenthesis.
> @@ -237,14 +217,13 @@ static int spmi_write_cmd(struct spmi_controller *ctrl,
[]
> - i = 0;
> - do {
> + for (i = 0; bc > i * SPMI_PER_DATAREG_BYTE; i++) {
> data = 0;
> if ((bc - i * SPMI_PER_DATAREG_BYTE) >> 2) {
> memcpy(&data, buf, sizeof(data));
> @@ -256,22 +235,22 @@ static int spmi_write_cmd(struct spmi_controller *ctrl,
>
> writel((u32)cpu_to_be32(data),
> spmi_controller->base + chnl_ofst + SPMI_APB_SPMI_WDATA0_BASE_ADDR + SPMI_PER_DATAREG_BYTE * i);
> - i++;
> - } while (bc > i * SPMI_PER_DATAREG_BYTE);
> + };
Unnecessary semicolon after for loop close brace.
Powered by blists - more mailing lists