* [PATCH] ALSA: usx2y: Delete an error message for a failed memory allocation in two functions
@ 2017-08-11 16:02 SF Markus Elfring
2017-08-12 21:20 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: SF Markus Elfring @ 2017-08-11 16:02 UTC (permalink / raw)
To: alsa-devel, Jaroslav Kysela, Takashi Iwai; +Cc: kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 11 Aug 2017 17:40:57 +0200
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
sound/usb/usx2y/usbusx2yaudio.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index dd40ca9d858a..612aa7ff7e18 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -422,7 +422,5 @@ static int usX2Y_urbs_allocate(struct snd_usX2Y_substream *subs)
- if (NULL = subs->tmpbuf) {
- snd_printk(KERN_ERR "cannot malloc tmpbuf\n");
+ if (!subs->tmpbuf)
return -ENOMEM;
- }
}
/* allocate and initialize data urbs */
for (i = 0; i < NRURBS; i++) {
@@ -952,7 +950,6 @@ static int usX2Y_audio_stream_new(struct snd_card *card, int playback_endpoint,
- if (NULL = usX2Y_substream[i]) {
- snd_printk(KERN_ERR "cannot malloc\n");
+ if (!usX2Y_substream[i])
return -ENOMEM;
- }
+
usX2Y_substream[i]->usX2Y = usX2Y(card);
}
--
2.14.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: usx2y: Delete an error message for a failed memory allocation in two functions
2017-08-11 16:02 [PATCH] ALSA: usx2y: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
@ 2017-08-12 21:20 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2017-08-12 21:20 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: alsa-devel, kernel-janitors, LKML
On Fri, 11 Aug 2017 18:02:15 +0200,
SF Markus Elfring wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 11 Aug 2017 17:40:57 +0200
>
> Omit an extra message for a memory allocation failure in these functions.
>
> This issue was detected by using the Coccinelle software.
>
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied, thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-12 21:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-11 16:02 [PATCH] ALSA: usx2y: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-08-12 21:20 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox