* [PATCH] fixing some coding style issues on line6 driver.c @ 2014-03-16 12:20 Davide Berardi 2014-03-16 16:37 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: Davide Berardi @ 2014-03-16 12:20 UTC (permalink / raw) To: gregkh; +Cc: linux-kernel Fixed some over-80 characters lines. (this is for eudyptula challenge task 10). From: Davide Berardi <berardi.dav@gmail.com> Signed-off-by: Davide Berardi <berardi.dav@gmail.com> --- diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index e7a9d8d..b3652e6 100644 --- 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_BASSPODXTPRO, "BassPODxtPro", "BassPODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_GUITARPORT, "GuitarPort", "GuitarPort", LINE6_BIT_PCM }, - { LINE6_BIT_POCKETPOD, "PocketPOD", "Pocket POD", LINE6_BIT_CONTROL }, - { LINE6_BIT_PODHD300, "PODHD300", "POD HD300", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODHD400, "PODHD400", "POD HD400", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODHD500, "PODHD500", "POD HD500", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODSTUDIO_GX, "PODStudioGX", "POD Studio GX", LINE6_BIT_PCM }, - { LINE6_BIT_PODSTUDIO_UX1, "PODStudioUX1", "POD Studio UX1", LINE6_BIT_PCM }, - { LINE6_BIT_PODSTUDIO_UX2, "PODStudioUX2", "POD Studio UX2", LINE6_BIT_PCM }, - { LINE6_BIT_PODX3, "PODX3", "POD X3", LINE6_BIT_PCM }, - { LINE6_BIT_PODX3LIVE, "PODX3Live", "POD X3 Live", LINE6_BIT_PCM }, - { LINE6_BIT_PODXT, "PODxt", "PODxt", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODXTLIVE, "PODxtLive", "PODxt Live", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODXTPRO, "PODxtPro", "PODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_TONEPORT_GX, "TonePortGX", "TonePort GX", LINE6_BIT_PCM }, - { LINE6_BIT_TONEPORT_UX1, "TonePortUX1", "TonePort UX1", LINE6_BIT_PCM }, - { LINE6_BIT_TONEPORT_UX2, "TonePortUX2", "TonePort UX2", LINE6_BIT_PCM }, - { LINE6_BIT_VARIAX, "Variax", "Variax Workbench", LINE6_BIT_CONTROL }, + { LINE6_BIT_BASSPODXT, "BassPODxt", + "BassPODxt", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_BASSPODXTLIVE, "BassPODxtLive", + "BassPODxt Live", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_BASSPODXTPRO, "BassPODxtPro", + "BassPODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_GUITARPORT, "GuitarPort", + "GuitarPort", LINE6_BIT_PCM }, + { LINE6_BIT_POCKETPOD, "PocketPOD", + "Pocket POD", LINE6_BIT_CONTROL }, + { LINE6_BIT_PODHD300, "PODHD300", + "POD HD300", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_PODHD400, "PODHD400", + "POD HD400", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_PODHD500, "PODHD500", + "POD HD500", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_PODSTUDIO_GX, "PODStudioGX", + "POD Studio GX", LINE6_BIT_PCM }, + { LINE6_BIT_PODSTUDIO_UX1, "PODStudioUX1", + "POD Studio UX1", LINE6_BIT_PCM }, + { LINE6_BIT_PODSTUDIO_UX2, "PODStudioUX2", + "POD Studio UX2", LINE6_BIT_PCM }, + { LINE6_BIT_PODX3, "PODX3", + "POD X3", LINE6_BIT_PCM }, + { LINE6_BIT_PODX3LIVE, "PODX3Live", + "POD X3 Live", LINE6_BIT_PCM }, + { LINE6_BIT_PODXT, "PODxt", + "PODxt", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_PODXTLIVE, "PODxtLive", + "PODxt Live", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_PODXTPRO, "PODxtPro", + "PODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, + { LINE6_BIT_TONEPORT_GX, "TonePortGX", + "TonePort GX", LINE6_BIT_PCM }, + { LINE6_BIT_TONEPORT_UX1, "TonePortUX1", + "TonePort UX1", LINE6_BIT_PCM }, + { LINE6_BIT_TONEPORT_UX2, "TonePortUX2", + "TonePort UX2", LINE6_BIT_PCM }, + { LINE6_BIT_VARIAX, "Variax", + "Variax Workbench", LINE6_BIT_CONTROL }, }; /* *INDENT-ON* */ @@ -152,10 +172,10 @@ int line6_send_raw_message(struct usb_line6 *line6, const char *buffer, int retval; retval = usb_interrupt_msg(line6->usbdev, - usb_sndintpipe(line6->usbdev, - line6->ep_control_write), - (char *)frag_buf, frag_size, - &partial, LINE6_TIMEOUT * HZ); + usb_sndintpipe(line6->usbdev, + line6->ep_control_write), + (char *)frag_buf, frag_size, + &partial, LINE6_TIMEOUT * HZ); if (retval) { dev_err(line6->ifcdev, ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fixing some coding style issues on line6 driver.c 2014-03-16 12:20 [PATCH] fixing some coding style issues on line6 driver.c Davide Berardi @ 2014-03-16 16:37 ` Greg KH 2014-03-16 16:55 ` Joe Perches 0 siblings, 1 reply; 5+ messages in thread From: Greg KH @ 2014-03-16 16:37 UTC (permalink / raw) To: Davide Berardi; +Cc: linux-kernel 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). > > From: Davide Berardi <berardi.dav@gmail.com> > > Signed-off-by: Davide Berardi <berardi.dav@gmail.com> > --- > diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c > index e7a9d8d..b3652e6 100644 > --- 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_BASSPODXTPRO, "BassPODxtPro", "BassPODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, > - { LINE6_BIT_GUITARPORT, "GuitarPort", "GuitarPort", LINE6_BIT_PCM }, > - { LINE6_BIT_POCKETPOD, "PocketPOD", "Pocket POD", LINE6_BIT_CONTROL }, > - { LINE6_BIT_PODHD300, "PODHD300", "POD HD300", LINE6_BIT_CONTROL_PCM_HWMON }, > - { LINE6_BIT_PODHD400, "PODHD400", "POD HD400", LINE6_BIT_CONTROL_PCM_HWMON }, > - { LINE6_BIT_PODHD500, "PODHD500", "POD HD500", LINE6_BIT_CONTROL_PCM_HWMON }, > - { LINE6_BIT_PODSTUDIO_GX, "PODStudioGX", "POD Studio GX", LINE6_BIT_PCM }, > - { LINE6_BIT_PODSTUDIO_UX1, "PODStudioUX1", "POD Studio UX1", LINE6_BIT_PCM }, > - { LINE6_BIT_PODSTUDIO_UX2, "PODStudioUX2", "POD Studio UX2", LINE6_BIT_PCM }, > - { LINE6_BIT_PODX3, "PODX3", "POD X3", LINE6_BIT_PCM }, > - { LINE6_BIT_PODX3LIVE, "PODX3Live", "POD X3 Live", LINE6_BIT_PCM }, > - { LINE6_BIT_PODXT, "PODxt", "PODxt", LINE6_BIT_CONTROL_PCM_HWMON }, > - { LINE6_BIT_PODXTLIVE, "PODxtLive", "PODxt Live", LINE6_BIT_CONTROL_PCM_HWMON }, > - { LINE6_BIT_PODXTPRO, "PODxtPro", "PODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, > - { LINE6_BIT_TONEPORT_GX, "TonePortGX", "TonePort GX", LINE6_BIT_PCM }, > - { LINE6_BIT_TONEPORT_UX1, "TonePortUX1", "TonePort UX1", LINE6_BIT_PCM }, > - { LINE6_BIT_TONEPORT_UX2, "TonePortUX2", "TonePort UX2", LINE6_BIT_PCM }, > - { LINE6_BIT_VARIAX, "Variax", "Variax Workbench", LINE6_BIT_CONTROL }, > + { 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. greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fixing some coding style issues on line6 driver.c 2014-03-16 16:37 ` Greg KH @ 2014-03-16 16:55 ` Joe Perches 2014-03-17 2:34 ` Davide Berardi 0 siblings, 1 reply; 5+ messages in thread From: Joe Perches @ 2014-03-16 16:55 UTC (permalink / raw) To: Greg KH; +Cc: Davide Berardi, linux-kernel 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[] = { ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fixing some coding style issues on line6 driver.c 2014-03-16 16:55 ` Joe Perches @ 2014-03-17 2:34 ` Davide Berardi 2014-03-17 19:08 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: Davide Berardi @ 2014-03-17 2:34 UTC (permalink / raw) To: gregkh; +Cc: joe, linux-kernel Thanks for your replies, I've applied your suggestions to the patch. Davide Fixed some line over 80 characters. From: Davide Berardi <berardi.dav@gmail.com> Signed-off-by: Davide Berardi <berardi.dav@gmail.com> --- drivers/staging/line6/driver.c | 54 ++++++++++++++++++++++------------------- drivers/staging/line6/usbdefs.h | 2 +- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index e7a9d8d..77f1b42 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -57,28 +57,32 @@ static const struct usb_device_id line6_id_table[] = { MODULE_DEVICE_TABLE(usb, line6_id_table); +#define L6PROP(dev_bit, dev_id, dev_name, dev_cap)\ + {.device_bit = LINE6_BIT_##dev_bit, .id = dev_id,\ + .name = dev_name, .capabilities = LINE6_BIT_##dev_cap} + /* *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_BASSPODXTPRO, "BassPODxtPro", "BassPODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_GUITARPORT, "GuitarPort", "GuitarPort", LINE6_BIT_PCM }, - { LINE6_BIT_POCKETPOD, "PocketPOD", "Pocket POD", LINE6_BIT_CONTROL }, - { LINE6_BIT_PODHD300, "PODHD300", "POD HD300", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODHD400, "PODHD400", "POD HD400", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODHD500, "PODHD500", "POD HD500", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODSTUDIO_GX, "PODStudioGX", "POD Studio GX", LINE6_BIT_PCM }, - { LINE6_BIT_PODSTUDIO_UX1, "PODStudioUX1", "POD Studio UX1", LINE6_BIT_PCM }, - { LINE6_BIT_PODSTUDIO_UX2, "PODStudioUX2", "POD Studio UX2", LINE6_BIT_PCM }, - { LINE6_BIT_PODX3, "PODX3", "POD X3", LINE6_BIT_PCM }, - { LINE6_BIT_PODX3LIVE, "PODX3Live", "POD X3 Live", LINE6_BIT_PCM }, - { LINE6_BIT_PODXT, "PODxt", "PODxt", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODXTLIVE, "PODxtLive", "PODxt Live", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_PODXTPRO, "PODxtPro", "PODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, - { LINE6_BIT_TONEPORT_GX, "TonePortGX", "TonePort GX", LINE6_BIT_PCM }, - { LINE6_BIT_TONEPORT_UX1, "TonePortUX1", "TonePort UX1", LINE6_BIT_PCM }, - { LINE6_BIT_TONEPORT_UX2, "TonePortUX2", "TonePort UX2", LINE6_BIT_PCM }, - { LINE6_BIT_VARIAX, "Variax", "Variax Workbench", LINE6_BIT_CONTROL }, +static const struct line6_properties line6_properties_table[] = { + L6PROP(BASSPODXT, "BassPODxt", "BassPODxt", CTRL_PCM_HW), + L6PROP(BASSPODXTLIVE, "BassPODxtLive", "BassPODxt Live", CTRL_PCM_HW), + L6PROP(BASSPODXTPRO, "BassPODxtPro", "BassPODxt Pro", CTRL_PCM_HW), + L6PROP(GUITARPORT, "GuitarPort", "GuitarPort", PCM), + L6PROP(POCKETPOD, "PocketPOD", "Pocket POD", CONTROL), + L6PROP(PODHD300, "PODHD300", "POD HD300", CTRL_PCM_HW), + L6PROP(PODHD400, "PODHD400", "POD HD400", CTRL_PCM_HW), + L6PROP(PODHD500, "PODHD500", "POD HD500", CTRL_PCM_HW), + L6PROP(PODSTUDIO_GX, "PODStudioGX", "POD Studio GX", PCM), + L6PROP(PODSTUDIO_UX1, "PODStudioUX1", "POD Studio UX1", PCM), + L6PROP(PODSTUDIO_UX2, "PODStudioUX2", "POD Studio UX2", PCM), + L6PROP(PODX3, "PODX3", "POD X3", PCM), + L6PROP(PODX3LIVE, "PODX3Live", "POD X3 Live", PCM), + L6PROP(PODXT, "PODxt", "PODxt", CTRL_PCM_HW), + L6PROP(PODXTLIVE, "PODxtLive", "PODxt Live", CTRL_PCM_HW), + L6PROP(PODXTPRO, "PODxtPro", "PODxt Pro", CTRL_PCM_HW), + L6PROP(TONEPORT_GX, "TonePortGX", "TonePort GX", PCM), + L6PROP(TONEPORT_UX1, "TonePortUX1", "TonePort UX1", PCM), + L6PROP(TONEPORT_UX2, "TonePortUX2", "TonePort UX2", PCM), + L6PROP(VARIAX, "Variax", "Variax Workbench", CONTROL), }; /* *INDENT-ON* */ @@ -152,10 +156,10 @@ int line6_send_raw_message(struct usb_line6 *line6, const char *buffer, int retval; retval = usb_interrupt_msg(line6->usbdev, - usb_sndintpipe(line6->usbdev, - line6->ep_control_write), - (char *)frag_buf, frag_size, - &partial, LINE6_TIMEOUT * HZ); + usb_sndintpipe(line6->usbdev, + line6->ep_control_write), + (char *)frag_buf, frag_size, + &partial, LINE6_TIMEOUT * HZ); if (retval) { dev_err(line6->ifcdev, diff --git a/drivers/staging/line6/usbdefs.h b/drivers/staging/line6/usbdefs.h index eda0456..2d1cc47 100644 --- a/drivers/staging/line6/usbdefs.h +++ b/drivers/staging/line6/usbdefs.h @@ -106,7 +106,7 @@ enum { /* device support hardware monitoring */ #define LINE6_BIT_HWMON (1 << 2) -#define LINE6_BIT_CONTROL_PCM_HWMON (LINE6_BIT_CONTROL | \ +#define LINE6_BIT_CTRL_PCM_HW (LINE6_BIT_CONTROL | \ LINE6_BIT_PCM | \ LINE6_BIT_HWMON) ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fixing some coding style issues on line6 driver.c 2014-03-17 2:34 ` Davide Berardi @ 2014-03-17 19:08 ` Greg KH 0 siblings, 0 replies; 5+ messages in thread From: Greg KH @ 2014-03-17 19:08 UTC (permalink / raw) To: Davide Berardi; +Cc: joe, linux-kernel On Mon, Mar 17, 2014 at 03:34:41AM +0100, Davide Berardi wrote: > Thanks for your replies, I've applied your suggestions to the patch. > > Davide > > Fixed some line over 80 characters. > > From: Davide Berardi <berardi.dav@gmail.com> > > Signed-off-by: Davide Berardi <berardi.dav@gmail.com> In the future, you should do this as: Subject: [PATCH v2] .... and don't put a response in the body, as I have to hand-edit it to fix this up... I'll do it this time, greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-17 19:06 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-03-16 12:20 [PATCH] fixing some coding style issues on line6 driver.c Davide Berardi 2014-03-16 16:37 ` Greg KH 2014-03-16 16:55 ` Joe Perches 2014-03-17 2:34 ` Davide Berardi 2014-03-17 19:08 ` Greg KH
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).