All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: taoyunxiang <taoyunxiang@cmss.chinamobile.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [PATCH] bus: fix code unused
Date: Mon, 16 May 2022 09:55:40 +0200	[thread overview]
Message-ID: <CAJFAV8zafgE1-htb1LPXigNQb3wHo7ox7rVKRGDWLjizbsUDiA@mail.gmail.com> (raw)
In-Reply-To: <20220512121958.2491-1-taoyunxiang@cmss.chinamobile.com>

On Mon, May 16, 2022 at 9:38 AM taoyunxiang
<taoyunxiang@cmss.chinamobile.com> wrote:
>
> The return value of pci_plug in pci_common.c
> will always be int vaule, can not be NULL.
> We could use not 0 to check it.

I don't see the relation between patch and commitlog.
Please clarify what is the issue you want to fix.


>
> Author: Tao YunXiang <taoyunxiang@cmss.chinamobile.com>
> Signed-off-by: Tao YunXiang <taoyunxiang@cmss.chinamobile.com>
>
> ---
>  lib/eal/common/eal_common_dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
> index 148a23830a..99677bae58 100644
> --- a/lib/eal/common/eal_common_dev.c
> +++ b/lib/eal/common/eal_common_dev.c
> @@ -143,7 +143,7 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev)
>         if (ret)
>                 goto err_devarg;
>
> -       if (da->bus->plug == NULL) {
> +       if (da->bus->plug != 0) {

The current (before patch) check is correct: it is allowed that a bus
does not support hotplug.
Inverting this check as you propose breaks hotplug.


>                 RTE_LOG(ERR, EAL, "Function plug not supported by bus (%s)\n",
>                         da->bus->name);
>                 ret = -ENOTSUP;


-- 
David Marchand


  reply	other threads:[~2022-05-16  7:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8>
2022-05-12 12:19 ` [PATCH] bus: fix code unused taoyunxiang
2022-05-16  7:55   ` David Marchand [this message]
2022-05-17  1:54     ` taoyunxiang
2022-05-18 12:07       ` David Marchand

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=CAJFAV8zafgE1-htb1LPXigNQb3wHo7ox7rVKRGDWLjizbsUDiA@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=taoyunxiang@cmss.chinamobile.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.