mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sound: Fix warnings relating to ignored return value in snd_card_register
@ 2008-11-18 15:59 Hannes Eder
  2008-11-18 16:14 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Hannes Eder @ 2008-11-18 15:59 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, kernel-janitors, linux-kernel

Do not ignore the return of 'device_create_file' in
'snd_card_register' and thereby fixing the following warnings:

sound/core/init.c: In function 'snd_card_register':
sound/core/init.c:640: warning: ignoring return value of
'device_create_file', declared with attribute warn_unused_result
sound/core/init.c:641: warning: ignoring return value of
'device_create_file', declared with attribute warn_unused_result

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
 sound/core/init.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/core/init.c b/sound/core/init.c
index af1e407..814d834 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -637,8 +637,10 @@ int snd_card_register(struct snd_card *card)
 #endif
 #ifndef CONFIG_SYSFS_DEPRECATED
 	if (card->card_dev) {
-		device_create_file(card->card_dev, &card_id_attrs);
-		device_create_file(card->card_dev, &card_number_attrs);
+		if ((err = device_create_file(card->card_dev, &card_id_attrs)) < 0)
+			return err;
+		if ((err = device_create_file(card->card_dev, &card_number_attrs)) < 0)
+			return err;
 	}
 #endif
 	return 0;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-11-18 17:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-18 15:59 [PATCH] sound: Fix warnings relating to ignored return value in snd_card_register Hannes Eder
2008-11-18 16:14 ` Takashi Iwai
2008-11-18 17:06   ` Hannes Eder
2008-11-18 17:12     ` Richard Holden
2008-11-18 17:12     ` Takashi Iwai
2008-11-18 17:25       ` Hannes Eder
2008-11-18 17:34         ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®