linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: fix return in pci_bus_add_device
Date: Thu, 29 May 2014 11:53:17 +0800	[thread overview]
Message-ID: <5386AF2D.9050803@huawei.com> (raw)
In-Reply-To: <CAE9FiQX6-E7xq9Ew=KJQnMf9NkorSBtsAEWt_9+PW2R_T5ABrg@mail.gmail.com>

On 2014/5/29 11:36, Yinghai Lu wrote:
> On Wed, May 28, 2014 at 6:37 PM, Yijing Wang <wangyijing@huawei.com> wrote:
>>>> I found some kernel code still check this return value, and I also think return the
>>>> real retval make sense.
>>>
>>> No, that is not right.
>>>
>>> If you look closely,
>>>
>>> device_attach() returns
>>> 1: success
>>> 0: not attached
>>> <0: fail.
>>
>> Hi Yinghai,
>>    Thanks for your explanation.
>> I found all the kernel code to check its return value, only for print a warning for users.
>>
>>
>> So I think we can drop all return checking from calling path
> 
> I prefer this one. as pci_bus_add_device already have
> 
>>         WARN_ON(retval < 0);
> 
> There is no need to print warning message later again.

OK, thanks for your suggestion.
I will send a patchset to clean the unnecessary check in kernel.

Hi Bjorn, please drop this patch.

Thanks!
Yijing.

> 
> 


-- 
Thanks!
Yijing


      reply	other threads:[~2014-05-29  3:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  3:32 [PATCH] PCI: fix return in pci_bus_add_device Yijing Wang
2014-05-28  3:22 ` Bjorn Helgaas
2014-05-28  3:32   ` Yijing Wang
2014-05-29  0:28     ` Yinghai Lu
2014-05-29  1:37       ` Yijing Wang
2014-05-29  3:36         ` Yinghai Lu
2014-05-29  3:53           ` Yijing Wang [this message]

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=5386AF2D.9050803@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=yinghai@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).