diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-31 06:32:19 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-04 09:09:13 -0500 |
commit | ae366c2049b48b54e5250cb57438bbebd1dbe610 (patch) | |
tree | f5f18985eed160653899066918e9a91d99cfbbf5 /sound | |
parent | a6cece9d81990e729c1f9da2a5bff2d29f7df649 (diff) |
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.c | 14 |
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) | |||
321 | return snd_usb_audio_free(chip); | 321 | return snd_usb_audio_free(chip); |
322 | } | 322 | } |
323 | 323 | ||
324 | static void remove_trailing_spaces(char *str) | ||
325 | { | ||
326 | char *p; | ||
327 | |||
328 | if (!*str) | ||
329 | return; | ||
330 | for (p = str + strlen(str) - 1; p >= str && isspace(*p); p--) | ||
331 | *p = 0; | ||
332 | } | ||
333 | |||
334 | /* | 324 | /* |
335 | * create a chip instance and set its names. | 325 | * create a chip instance and set its names. |
336 | */ | 326 | */ |
@@ -414,7 +404,7 @@ static int snd_usb_audio_create(struct usb_interface *intf, | |||
414 | USB_ID_PRODUCT(chip->usb_id)); | 404 | USB_ID_PRODUCT(chip->usb_id)); |
415 | } | 405 | } |
416 | } | 406 | } |
417 | remove_trailing_spaces(card->shortname); | 407 | strim(card->shortname); |
418 | 408 | ||
419 | /* retrieve the vendor and device strings as longname */ | 409 | /* retrieve the vendor and device strings as longname */ |
420 | if (quirk && quirk->vendor_name && *quirk->vendor_name) { | 410 | if (quirk && quirk->vendor_name && *quirk->vendor_name) { |
@@ -428,7 +418,7 @@ static int snd_usb_audio_create(struct usb_interface *intf, | |||
428 | /* we don't really care if there isn't any vendor string */ | 418 | /* we don't really care if there isn't any vendor string */ |
429 | } | 419 | } |
430 | if (len > 0) { | 420 | if (len > 0) { |
431 | remove_trailing_spaces(card->longname); | 421 | strim(card->longname); |
432 | if (*card->longname) | 422 | if (*card->longname) |
433 | strlcat(card->longname, " ", sizeof(card->longname)); | 423 | strlcat(card->longname, " ", sizeof(card->longname)); |
434 | } | 424 | } |