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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 23 Dec 2014 16:55:59 -0800
From:	Joe Perches <joe@...ches.com>
To:	Rafał Miłecki <zajec5@...il.com>
Cc:	Oscar Forner Martinez <oscar.forner.martinez@...il.com>,
	"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Drivers: bcma: Fix three coding style issues, more than
 80 characters per line.

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@...il.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@...il.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 */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists