lkml.org 
[lkml]   [2008]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH] sound: Fix warnings relating to ignored return value in snd_card_register
    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>
    ---

    On Tue, Nov 18, 2008 at 11:14 AM, Takashi Iwai <tiwai@suse.de> wrote:
    > The changes look good, but please run checkpatch.pl to your patch and
    > fix the coding style issues suggested there.

    I did not fix:

    "WARNING: line over 80 characters" as they a hardly longer than 80
    characters and there are lines longer than this in the same file.

    "ERROR: do not use assignment in if condition" as this pattern seems
    to be quite common.

    Comments? Should I fix them?

    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;

    \
     
     \ /
      Last update: 2008-11-18 18:09    [W:0.031 / U:0.480 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site