From: Dan Carpenter <dan.carpenter@oracle.com>
To: Fabian Krueger <fabian.krueger@fau.de>
Cc: devel@driverdev.osuosl.org, linux-kernel@i4.cs.fau.de,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Michael Scheiderer <michael.scheiderer@fau.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/8] staging: kpc2000: add line breaks
Date: Tue, 25 Jun 2019 14:52:51 +0300 [thread overview]
Message-ID: <20190625115251.GA28859@kadam> (raw)
In-Reply-To: <20190625112725.10154-2-fabian.krueger@fau.de>
On Tue, Jun 25, 2019 at 01:27:12PM +0200, Fabian Krueger wrote:
> diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
> index c3e5c1848f53..7ed0fb6b4abb 100644
> --- a/drivers/staging/kpc2000/kpc2000_spi.c
> +++ b/drivers/staging/kpc2000/kpc2000_spi.c
> @@ -30,18 +30,46 @@
> #include "kpc.h"
>
> static struct mtd_partition p2kr0_spi0_parts[] = {
> - { .name = "SLOT_0", .size = 7798784, .offset = 0, },
> - { .name = "SLOT_1", .size = 7798784, .offset = MTDPART_OFS_NXTBLK},
> - { .name = "SLOT_2", .size = 7798784, .offset = MTDPART_OFS_NXTBLK},
> - { .name = "SLOT_3", .size = 7798784, .offset = MTDPART_OFS_NXTBLK},
> - { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = MTDPART_OFS_NXTBLK},
> + {.name = "SLOT_0",
> + .size = 7798784,
> + .offset = 0,},
> +
> + {.name = "SLOT_1",
> + .size = 7798784,
> + .offset = MTDPART_OFS_NXTBLK},
> +
> + {.name = "SLOT_2",
> + .size = 7798784,
> + .offset = MTDPART_OFS_NXTBLK},
> +
> + {.name = "SLOT_3",
> + .size = 7798784,
> + .offset = MTDPART_OFS_NXTBLK},
> +
> + {.name = "CS0_EXTRA",
> + .size = MTDPART_SIZ_FULL,
> + .offset = MTDPART_OFS_NXTBLK},
> };
The original is fine/better.
> @@ -215,7 +244,9 @@ kp_spi_txrx_pio(struct spi_device *spidev, struct spi_transfer *transfer)
> for (i = 0 ; i < c ; i++) {
> char val = *tx++;
>
> - if (kp_spi_wait_for_reg_bit(cs, KP_SPI_REG_STATUS, KP_SPI_REG_STATUS_TXS) < 0) {
> + if (kp_spi_wait_for_reg_bit(cs, KP_SPI_REG_STATUS,
> + KP_SPI_REG_STATUS_TXS)
> + < 0) {
I don't like how the < 0 is on the next line. It would be better to
introduce an "int ret;"
ret = kp_spi_wait_for_reg_bit(cs, KP_SPI_REG_STATUS,
KP_SPI_REG_STATUS_TXS);
if (ret < 0)
goto out;
> goto out;
> }
>
> @@ -317,7 +353,8 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
> dev_dbg(kpspi->dev, " transfer -EINVAL\n");
> return -EINVAL;
> }
> - if (transfer->speed_hz && (transfer->speed_hz < (KP_SPI_CLK >> 15))) {
> + if (transfer->speed_hz && (transfer->speed_hz <
> + (KP_SPI_CLK >> 15))) {
Move the whole conition down:
if (transfer->speed_hz &&
transfer->speed_hz < (KP_SPI_CLK >> 15)) {
regards,
dan carpenter
next prev parent reply other threads:[~2019-06-25 11:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 11:27 [PATCH 0/8] staging: kpc2000: style refactoring Fabian Krueger
2019-06-25 11:27 ` [PATCH 1/8] staging: kpc2000: add line breaks Fabian Krueger
2019-06-25 11:52 ` Dan Carpenter [this message]
2019-06-26 7:35 ` [PATCH 0/8] staging: kpc2000: style refactoring Fabian Krueger
2019-06-26 7:35 ` [PATCH 1/8] staging: kpc2000: add line breaks Fabian Krueger
2019-07-01 8:41 ` Greg Kroah-Hartman
2019-06-26 7:35 ` [PATCH 2/8] staging: kpc2000: blank lines after declaration Fabian Krueger
2019-06-26 7:35 ` [PATCH 3/8] staging: kpc2000: introduce usage of __packed Fabian Krueger
2019-06-26 7:35 ` [PATCH 4/8] staging: kpc2000: remove unnecessary brackets Fabian Krueger
2019-06-26 7:35 ` [PATCH 5/8] staging: kpc2000: add spaces Fabian Krueger
2019-06-26 7:35 ` [PATCH 6/8] staging: kpc2000: introduce 'unsigned int' Fabian Krueger
2019-06-26 7:35 ` [PATCH 7/8] staging: kpc2000: introduce __func__ Fabian Krueger
2019-06-26 7:35 ` [PATCH 8/8] staging: kpc2000: remove needless 'break' Fabian Krueger
2019-06-26 7:50 ` [PATCH 0/8] staging: kpc2000: style refactoring Dan Carpenter
2019-06-25 11:27 ` [PATCH 2/8] staging: kpc2000: blank lines after declaration Fabian Krueger
2019-06-25 11:27 ` [PATCH 3/8] staging: kpc2000: introduce usage of __packed Fabian Krueger
2019-06-25 11:27 ` [PATCH 4/8] staging: kpc2000: add spaces Fabian Krueger
2019-06-25 11:54 ` Dan Carpenter
2019-06-25 11:27 ` [PATCH 5/8] staging: kpc2000: remove unnecessary brackets Fabian Krueger
2019-06-25 11:27 ` [PATCH 6/8] staging: kpc2000: introduce 'unsigned int' Fabian Krueger
2019-06-25 11:55 ` Dan Carpenter
2019-06-25 11:27 ` [PATCH 7/8] staging: kpc2000: introduce __func__ Fabian Krueger
2019-06-25 11:27 ` [PATCH 8/8] staging: kpc2000: remove needless 'break' Fabian Krueger
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=20190625115251.GA28859@kadam \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=fabian.krueger@fau.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@i4.cs.fau.de \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.scheiderer@fau.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox