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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 19 Feb 2017 10:27:28 -0800
From:   Joe Perches <joe@...ches.com>
To:     Julia Lawall <julia.lawall@...6.fr>,
        Arushi Singhal <arushisinghal19971997@...il.com>
Cc:     gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org, outreachy-kernel@...glegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: ks7010: There should be no
 spaces at the start of a line

On Sat, 2017-02-18 at 18:00 +0100, Julia Lawall wrote:
> On Sat, 18 Feb 2017, Arushi Singhal wrote:
> > The following patch the checkpatch.pl warning:
> > drivers/staging/ks7010/ks_hostif.c warning: please, no spaces at the
> > start of a line
[]
> > diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
[]
> > @@ -191,8 +191,8 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
> >  	}
> >  	DPRINTK(4, "\n    Link AP\n");
> >  	DPRINTK(4, "    bssid=%02X:%02X:%02X:%02X:%02X:%02X\n \
> > -   essid=%s\n    rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n    channel=%d\n \
> > -   rssi=%d\n    sq=%d\n    capability=%04X\n", ap->bssid
> > +essid=%s\n    rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n    channel=%d\n \
> > +rssi=%d\n    sq=%d\n    capability=%04X\n", ap->bssid[0], ap->bssid[1], ap->bssid[2], ap->bssid[3], ap->bssid[4], ap->bssid[5], &(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1], ap->rate_set.body[2], ap->rate_set.body[3], ap->rate_set.body[4], ap->rate_set.body[5], ap->rate_set.body[6], ap->rate_set.body[7], ap->channel, ap->rssi, ap->sq, ap->capability);
> 
> The code looks like a mess.  How about breaking up the call at the
> newlines, and then propagating the arguments to the appropriate calls.
> 
> There is also a checkpatch error about strings on more than one line, that
> this also violates.

There are also vsprintf %p<foo> extensions that would
simplify the code for this output and for many others.

see Documentation/printk-formats.txt

something like:

	DPRINTK(4, "    bssid=%pM\n", ap->bssid);
	DPRINTK(4, "    essid=%s\n", ap->ssid.body);
	DPRINTK(4, "    rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n",
		ap->rate_set.body[0], ap->rate_set.body[1],
		ap->rate_set.body[2], ap->rate_set.body[3],
		ap->rate_set.body[4], ap->rate_set.body[5],
		ap->rate_set.body[6], ap->rate_set.body[7]);	
	DPRINTK(4, "    channel=%d\n", ap->channel);
	DPRINTK(4, "    rssi=%d\n", ap->rssi);
	DPRINTK(4, "    sq=%d\n", ap->sq);
	DPRINTK(4, "   
capability=%04X\n", ap->capability);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ