From: Li Yang <leoli@freescale.com>
To: michael@ellerman.id.au
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
akpm@linux-foundation.org
Subject: Re: [PATCH] rio: warn_unused_result warnings fix
Date: Tue, 28 Apr 2009 19:08:13 +0800 [thread overview]
Message-ID: <2a27d3730904280408j636d8e4tc1b6e1c827509379@mail.gmail.com> (raw)
In-Reply-To: <1240915882.15414.3.camel@localhost>
On Tue, Apr 28, 2009 at 6:51 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> On Tue, 2009-04-28 at 18:15 +0800, Li Yang wrote:
>> warning: ignoring return value of 'device_add', declared with attribute =
warn_unused_result
>> warning: ignoring return value of 'sysfs_create_bin_file', declared with=
attribute warn_unused_result
>>
>> Signed-off-by: Li Yang <leoli@freescale.com>
>> ---
>> =C2=A0drivers/rapidio/rio-scan.c =C2=A0| =C2=A0 =C2=A05 ++++-
>> =C2=A0drivers/rapidio/rio-sysfs.c | =C2=A0 =C2=A06 ++++--
>> =C2=A02 files changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
>> index 74d0bfa..9309e24 100644
>> --- a/drivers/rapidio/rio-scan.c
>> +++ b/drivers/rapidio/rio-scan.c
>> @@ -265,7 +265,10 @@ static void rio_route_set_ops(struct rio_dev *rdev)
>> =C2=A0 */
>> =C2=A0static void __devinit rio_add_device(struct rio_dev *rdev)
>> =C2=A0{
>> - =C2=A0 =C2=A0 device_add(&rdev->dev);
>> + =C2=A0 =C2=A0 int err;
>> +
>> + =C2=A0 =C2=A0 err =3D device_add(&rdev->dev);
>> + =C2=A0 =C2=A0 WARN_ON(err);
>>
>> =C2=A0 =C2=A0 =C2=A0 spin_lock(&rio_global_list_lock);
>> =C2=A0 =C2=A0 =C2=A0 list_add_tail(&rdev->global_list, &rio_devices);
>
> Is that really useful? Why not return the error to rio_setup_device()
> which can tell it's caller.
IMHO, when device_add() fails the system is quite broken. So the
value is very limited for it to fail cleanly, which need some effort
to implement. I can add it if you insist.
- Leo
next prev parent reply other threads:[~2009-04-28 11:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 10:16 [PATCH 0/5] rapidio: adding memory mapping IO support and misc fixes Li Yang
2009-04-28 10:15 ` [PATCH] rapidio: add common mapping APIs for RapidIO memory access Li Yang
2009-04-28 10:15 ` [PATCH] powerpc/fsl_rio: use LAW address from device tree Li Yang
2009-04-28 10:15 ` [PATCH] powerpc: add memory map support to Freescale RapioIO block Li Yang
2009-04-28 10:15 ` [PATCH] rionet: add memory access to simulated Ethernet over rapidio Li Yang
2009-04-28 10:15 ` [PATCH] rio: warn_unused_result warnings fix Li Yang
2009-04-28 10:51 ` Michael Ellerman
2009-04-28 11:08 ` Li Yang [this message]
2009-04-28 11:38 ` David Miller
2009-04-28 11:39 ` [PATCH] rapidio: add common mapping APIs for RapidIO memory access David Miller
2009-04-30 5:10 ` Li Yang
2009-04-30 11:45 ` Kumar Gala
2009-04-28 12:06 ` [PATCH 0/5] rapidio: adding memory mapping IO support and misc fixes Kumar Gala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a27d3730904280408j636d8e4tc1b6e1c827509379@mail.gmail.com \
--to=leoli@freescale.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).