[PATCH] ALSA: usb-audio: Fix coding style problems
From: Atul Gopinathan leoatul12@gmail.com
Hi,
This patch fixes some coding style warnings and errors that were generated using scripts/checkpatch.pl.
Signed-off-by: Atul Gopinathan leoatul12@gmail.com --- sound/usb/pcm.c | 16 ++++++++-------- sound/usb/quirks.c | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index a860303cc522..ed5c77ce8e14 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -104,7 +104,7 @@ static struct audioformat *find_format(struct snd_usb_substream *subs) continue; } attr = fp->ep_attr & USB_ENDPOINT_SYNCTYPE; - if (! found) { + if (!found) { found = fp; cur_attr = attr; continue; @@ -304,7 +304,7 @@ static int search_roland_implicit_fb(struct usb_device *dev, int ifnum, if (altsd->bAlternateSetting != altsetting || altsd->bInterfaceClass != USB_CLASS_VENDOR_SPEC || (altsd->bInterfaceSubClass != 2 && - altsd->bInterfaceProtocol != 2 ) || + altsd->bInterfaceProtocol != 2) || altsd->bNumEndpoints < 1) return -ENOENT; epd = get_endpoint(*alts, 0); @@ -482,8 +482,9 @@ static int set_sync_endpoint(struct snd_usb_substream *subs,
/* check sync-pipe endpoint */ /* ... and check descriptor size before accessing bSynchAddress - because there is a version of the SB Audigy 2 NX firmware lacking - the audio fields in the endpoint descriptors */ + * because there is a version of the SB Audigy 2 NX firmware lacking + * the audio fields in the endpoint descriptors + */ if ((get_endpoint(alts, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_ISOC || (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && get_endpoint(alts, 1)->bSynchAddress != 0)) { @@ -911,7 +912,7 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) struct usb_interface *iface; int ret;
- if (! subs->cur_audiofmt) { + if (!subs->cur_audiofmt) { dev_err(&subs->dev->dev, "no format is specified!\n"); return -ENXIO; } @@ -973,9 +974,8 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) return ret; }
-static const struct snd_pcm_hardware snd_usb_hardware = -{ - .info = SNDRV_PCM_INFO_MMAP | +static const struct snd_pcm_hardware snd_usb_hardware = { + .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BATCH | SNDRV_PCM_INFO_INTERLEAVED | diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index c989ad8052ae..b6f3345db93f 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -398,7 +398,7 @@ static int create_autodetect_quirks(struct snd_usb_audio *chip, }
/* - * Create a stream for an Edirol UA-700/UA-25/UA-4FX interface. + * Create a stream for an Edirol UA-700/UA-25/UA-4FX interface. * The only way to detect the sample rate is by looking at wMaxPacketSize. */ static int create_uaxx_quirk(struct snd_usb_audio *chip, @@ -593,7 +593,7 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_NEW) { dev_dbg(&dev->dev, "sending Extigy boot sequence...\n"); /* Send message to force it to reconnect with full interface. */ - err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0), + err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 0x10, 0x43, 0x0001, 0x000a, NULL, 0); if (err < 0) dev_dbg(&dev->dev, "error sending boot message: %d\n", err); @@ -646,8 +646,9 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev) "error usb_driver_set_configuration: %d\n", err); /* Always return an error, so that we stop creating a device - that will just be destroyed and recreated with a new - configuration */ + * that will just be destroyed and recreated with a new + * configuration + */ return -ENODEV; } else dev_info(&dev->dev, "Fast Track Pro config OK\n"); @@ -895,9 +896,10 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev) usb_reset_device(dev);
/* return -EAGAIN, so the creation of an audio interface for this - * temporary device is aborted. The device will reconnect with a - * new product ID */ - return -EAGAIN; + * temporary device is aborted. The device will reconnect with a + * new product ID + */ + return -EAGAIN; }
static void mbox2_setup_48_24_magic(struct usb_device *dev) @@ -919,7 +921,6 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev) 0x81, 0xa2, 0x0100, 0x0086, &srate, 0x0003); snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 0x81, 0xa2, 0x0100, 0x0003, &srate, 0x0003); - return; }
/* Digidesign Mbox 2 needs to load firmware onboard @@ -1830,8 +1831,8 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, /* doesn't set the sample rate attribute, but supports it */ fp->attributes |= UAC_EP_CS_ATTR_SAMPLE_RATE; break; - case USB_ID(0x0763, 0x2001): /* M-Audio Quattro USB */ - case USB_ID(0x0763, 0x2012): /* M-Audio Fast Track Pro USB */ + case USB_ID(0x0763, 0x2001): /* M-Audio Quattro USB */ + case USB_ID(0x0763, 0x2012): /* M-Audio Fast Track Pro USB */ case USB_ID(0x047f, 0x0ca1): /* plantronics headset */ case USB_ID(0x077d, 0x07af): /* Griffin iMic (note that there is an older model 77d:223) */
On Sun, Nov 08, 2020 at 02:05:16PM +0530, Atul wrote:
From: Atul Gopinathan leoatul12@gmail.com
Hi,
No need for this to be in the changelog.
This patch fixes some coding style warnings and errors that were generated using scripts/checkpatch.pl.
You should be explicit about _what_ warnings and errors. And probably break them out into individual patches, one per warning/error type.
But more importantly, always run your patch through checkpatch.pl when you are done, as you just _ADDED_ warnings to the kernel with this change:
@@ -895,9 +896,10 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev) usb_reset_device(dev);
/* return -EAGAIN, so the creation of an audio interface for this
* temporary device is aborted. The device will reconnect with a
* new product ID */
- return -EAGAIN;
* temporary device is aborted. The device will reconnect with a
* new product ID
*/
- return -EAGAIN;
}
static void mbox2_setup_48_24_magic(struct usb_device *dev)
You turned tabs into spaces, not allowed, sorry.
If you want to do basic checkpatch cleanups, try starting in the drivers/staging/ area of the kernel, which is much more forgiving and set up just for this type of thing, instead of trying to do this in the "core" kernel portions, where you have to deal with other real code changing happening at the same time.
good luck!
greg k-h
On Sun, Nov 08, 2020 at 10:11:36AM +0100, Greg KH wrote:
On Sun, Nov 08, 2020 at 02:05:16PM +0530, Atul wrote:
From: Atul Gopinathan leoatul12@gmail.com
Hi,
No need for this to be in the changelog.
This patch fixes some coding style warnings and errors that were generated using scripts/checkpatch.pl.
You should be explicit about _what_ warnings and errors. And probably break them out into individual patches, one per warning/error type.
Got it, I'll keep the above points in mind.
But more importantly, always run your patch through checkpatch.pl when you are done, as you just _ADDED_ warnings to the kernel with this change:
@@ -895,9 +896,10 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev) usb_reset_device(dev);
/* return -EAGAIN, so the creation of an audio interface for this
* temporary device is aborted. The device will reconnect with a
* new product ID */
- return -EAGAIN;
* temporary device is aborted. The device will reconnect with a
* new product ID
*/
- return -EAGAIN;
}
static void mbox2_setup_48_24_magic(struct usb_device *dev)
You turned tabs into spaces, not allowed, sorry.
I truly apologize for this blunder. That was a really silly mistake from my side inspite of having seen your FOSDEM talk on 'Submitting Your First Kernel Patch' and using indentations as they were intended to be a hundred times.
If you want to do basic checkpatch cleanups, try starting in the drivers/staging/ area of the kernel, which is much more forgiving and set up just for this type of thing, instead of trying to do this in the "core" kernel portions, where you have to deal with other real code changing happening at the same time.
I guess I'll start with this instead of messing with the "core" code. I'm still in my learning phase, so checkpatch cleanups are the only contributions I can make for now. :D
good luck!
greg k-h
Thanks a lot for your patience!
Atul
participants (3)
-
Atul
-
Atul Gopinathan
-
Greg KH