summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-31 13:32:19 +0300
committerTakashi Iwai <tiwai@suse.de>2014-11-04 17:09:13 +0300
commitae366c2049b48b54e5250cb57438bbebd1dbe610 (patch)
treef5f18985eed160653899066918e9a91d99cfbbf5 /sound
parenta6cece9d81990e729c1f9da2a5bff2d29f7df649 (diff)
downloadlinux-ae366c2049b48b54e5250cb57438bbebd1dbe610.tar.xz
ALSA: usb-audio: Use strim() instead of open code
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/card.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index fa6c0972aa23..69725d5fa2d6 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -321,16 +321,6 @@ static int snd_usb_audio_dev_free(struct snd_device *device)
return snd_usb_audio_free(chip);
}
-static void remove_trailing_spaces(char *str)
-{
- char *p;
-
- if (!*str)
- return;
- for (p = str + strlen(str) - 1; p >= str && isspace(*p); p--)
- *p = 0;
-}
-
/*
* create a chip instance and set its names.
*/
@@ -414,7 +404,7 @@ static int snd_usb_audio_create(struct usb_interface *intf,
USB_ID_PRODUCT(chip->usb_id));
}
}
- remove_trailing_spaces(card->shortname);
+ strim(card->shortname);
/* retrieve the vendor and device strings as longname */
if (quirk && quirk->vendor_name && *quirk->vendor_name) {
@@ -428,7 +418,7 @@ static int snd_usb_audio_create(struct usb_interface *intf,
/* we don't really care if there isn't any vendor string */
}
if (len > 0) {
- remove_trailing_spaces(card->longname);
+ strim(card->longname);
if (*card->longname)
strlcat(card->longname, " ", sizeof(card->longname));
}