From: Joe Perches <joe@perches.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Oscar Forner Martinez <oscar.forner.martinez@gmail.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Drivers: bcma: Fix three coding style issues, more than 80 characters per line.
Date: Tue, 23 Dec 2014 16:55:59 -0800 [thread overview]
Message-ID: <1419382559.6157.1.camel@perches.com> (raw)
In-Reply-To: <CACna6rwTwrZurN+bgerQu_UPsTTv=1iB-C3_MeMiQN0GSyDoMg@mail.gmail.com>
On Wed, 2014-12-24 at 00:46 +0100, Rafał Miłecki wrote:
> On 24 December 2014 at 00:55, Oscar Forner Martinez
> <oscar.forner.martinez@gmail.com> wrote:
> > Three lines with more than 80 characters per line have been split in several lines.
> >
> > Signed-off-by: Oscar Forner Martinez <oscar.forner.martinez@gmail.com>
> > ---
> > drivers/bcma/driver_chipcommon.c | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/bcma/driver_chipcommon.c b/drivers/bcma/driver_chipcommon.c
[]
> > - bcma_err(cc->core->bus, "serial not supported on this device ccrev: 0x%x\n", ccrev);
> > + bcma_err(cc->core->bus,
> > + "serial not supported on this device ccrev: 0x%x\n",
> > + ccrev);
>
> I think some subsystems agreed to keep dev/bus pointed and string in
> the one line. It makes more sense for me too.
And it would probably be better to invert the test above
and error out immediately to reduce the indentation.
Something like:
drivers/bcma/driver_chipcommon.c | 42 +++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/drivers/bcma/driver_chipcommon.c b/drivers/bcma/driver_chipcommon.c
index 19f6796..e63fabfc 100644
--- a/drivers/bcma/driver_chipcommon.c
+++ b/drivers/bcma/driver_chipcommon.c
@@ -316,29 +316,31 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
unsigned int ccrev = cc->core->id.rev;
struct bcma_serial_port *ports = cc->serial_ports;
- if (ccrev >= 11 && ccrev != 15) {
- baud_base = bcma_chipco_get_alp_clock(cc);
- if (ccrev >= 21) {
- /* Turn off UART clock before switching clocksource. */
- bcma_cc_write32(cc, BCMA_CC_CORECTL,
- bcma_cc_read32(cc, BCMA_CC_CORECTL)
- & ~BCMA_CC_CORECTL_UARTCLKEN);
- }
- /* Set the override bit so we don't divide it */
- bcma_cc_write32(cc, BCMA_CC_CORECTL,
- bcma_cc_read32(cc, BCMA_CC_CORECTL)
- | BCMA_CC_CORECTL_UARTCLK0);
- if (ccrev >= 21) {
- /* Re-enable the UART clock. */
- bcma_cc_write32(cc, BCMA_CC_CORECTL,
- bcma_cc_read32(cc, BCMA_CC_CORECTL)
- | BCMA_CC_CORECTL_UARTCLKEN);
- }
- } else {
- bcma_err(cc->core->bus, "serial not supported on this device ccrev: 0x%x\n", ccrev);
+ if (ccrev < 11 || ccrev == 15) {
+ bcma_err(cc->core->bus,
+ "serial not supported on this device ccrev: 0x%x\n",
+ ccrev);
return;
}
+ baud_base = bcma_chipco_get_alp_clock(cc);
+ if (ccrev >= 21) {
+ /* Turn off UART clock before switching clocksource */
+ bcma_cc_write32(cc, BCMA_CC_CORECTL,
+ bcma_cc_read32(cc, BCMA_CC_CORECTL)
+ & ~BCMA_CC_CORECTL_UARTCLKEN);
+ }
+ /* Set the override bit so we don't divide it */
+ bcma_cc_write32(cc, BCMA_CC_CORECTL,
+ bcma_cc_read32(cc, BCMA_CC_CORECTL) |
+ BCMA_CC_CORECTL_UARTCLK0);
+ if (ccrev >= 21) {
+ /* Re-enable the UART clock */
+ bcma_cc_write32(cc, BCMA_CC_CORECTL,
+ bcma_cc_read32(cc, BCMA_CC_CORECTL)
+ | BCMA_CC_CORECTL_UARTCLKEN);
+ }
+
irq = bcma_core_irq(cc->core, 0);
/* Determine the registers of the UARTs */
next prev parent reply other threads:[~2014-12-24 0:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-23 23:55 [PATCH] Drivers: bcma: Fix three coding style issues, more than 80 characters per line Oscar Forner Martinez
2014-12-23 23:46 ` Rafał Miłecki
2014-12-24 0:55 ` Joe Perches [this message]
2014-12-23 23:47 ` Rafał Miłecki
2014-12-24 7:20 ` Kalle Valo
2014-12-24 9:09 ` Arend van Spriel
2014-12-24 9:44 ` Òscar Forner Martínez
2014-12-26 9:19 ` Rafał Miłecki
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=1419382559.6157.1.camel@perches.com \
--to=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=oscar.forner.martinez@gmail.com \
--cc=zajec5@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).