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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1394988926.5689.39.camel@joe-AO722>
Date:	Sun, 16 Mar 2014 09:55:26 -0700
From:	Joe Perches <joe@...ches.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Davide Berardi <berardi.dav@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fixing some coding style issues on line6 driver.c

On Sun, 2014-03-16 at 16:37 +0000, Greg KH wrote:
> On Sun, Mar 16, 2014 at 01:20:16PM +0100, Davide Berardi wrote:
> > Fixed some over-80 characters lines.
> > (this is for eudyptula challenge task 10).
[]
> > diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
[]
> > @@ -59,26 +59,46 @@ MODULE_DEVICE_TABLE(usb, line6_id_table);
> >  
> >  /* *INDENT-OFF* */
> >  static struct line6_properties line6_properties_table[] = {
> > -	{ LINE6_BIT_BASSPODXT,     "BassPODxt",     "BassPODxt",        LINE6_BIT_CONTROL_PCM_HWMON },
> > -	{ LINE6_BIT_BASSPODXTLIVE, "BassPODxtLive", "BassPODxt Live",   LINE6_BIT_CONTROL_PCM_HWMON },
[]
> > +	{ LINE6_BIT_BASSPODXT,     "BassPODxt",
> > +		"BassPODxt",        LINE6_BIT_CONTROL_PCM_HWMON },
> > +	{ LINE6_BIT_BASSPODXTLIVE, "BassPODxtLive",
> > +		"BassPODxt Live",   LINE6_BIT_CONTROL_PCM_HWMON },
> 
> That looks worse, sorry, I can't take this.

Thanks Greg.

Davide, you _might_ add a simplifying macro if you really
wanted this to be a bit neater, but any gains are going
to be _very_ minor.

>  static struct line6_properties line6_properties_table[] = {
> > -	{ LINE6_BIT_BASSPODXT,     "BassPODxt",     "BassPODxt",        LINE6_BIT_CONTROL_PCM_HWMON },

The struct is:

struct line6_properties {
	int device_bit;
	const char *id;
	const char *name;
	int capabilities;
};

Here's a possible simplifying macro:

#define L6_PROP(dev, id, name, cap) \
	{.int = LINE6_BIT_##bit, .id = id, .name = name, .capabilities = LINE6_BIT_##cap}

so the entries could become:

static struct line6_properties line6_properties_table[] = {
	L6_PROP(BASSPODXT, "BassPODxt", "BassPODxt", CONTROL_PCM_HWMON),
etc.

But even that isn't necessarily better.

Probably the better improvement here would be to change
the declaration of line6_properties_table to

static const struct line6_properties line6_properties_table[] = {


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ