From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D1F7DA00BE; Mon, 16 May 2022 09:55:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1BC540A7A; Mon, 16 May 2022 09:55:56 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1208640A79 for ; Mon, 16 May 2022 09:55:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652687754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c1H7BgjtuKm87f1mP8sUSub4r/PbCuRatDf2e1hfYL0=; b=beY4fCiXWQkvv57JazE+6fUqCckJOvQ2u0RKY5lLpBBNR7t+DzeqJsdVaIaTN0YhB1LaZ3 K/ESi4kRNoQU6LpCu94RF42HrOv4mQlBAEA2Go9MJuBhtaER1Sk4/Idvg94W+ZVc7zuSsb YUHxl0353LD1d1qfIVVurCHb+FFH19k= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-98-XiTW2S6lMM-htlFtlYUUXA-1; Mon, 16 May 2022 03:55:53 -0400 X-MC-Unique: XiTW2S6lMM-htlFtlYUUXA-1 Received: by mail-lf1-f69.google.com with SMTP id n3-20020ac242c3000000b00473d8af3a0cso6112340lfl.21 for ; Mon, 16 May 2022 00:55:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c1H7BgjtuKm87f1mP8sUSub4r/PbCuRatDf2e1hfYL0=; b=Qu79iep8cETwJey0yjRSIMcwuHD6u4leCF1IonwJP7q67NV/kbOdca7ol+C7TACRG+ PYLX3tCpMOtkFFhR7TqycP0e3r2qORclGTWJ8nxyd2ksiaKEhIIvj9t5lLBj9+3AQLen yULenpasqaWQtbj2utHLerBlxDIO5gemy5YQeCR2/ikwt7zlfbgFf4YHi1bKMkQ+Fhy4 8qzEgtJohzXPmTY3ed057g49/zfD5e/k4p/d8klFNzGWZ8aE+WxGBi23o5pCDlCUzA7F 5B86Vmx/hXZiXV+5cR7XU1XQhURpeaVM2LpTdQ4LKP+8scGfNTW3nPpOzPtbTqx0I6Hg BUZw== X-Gm-Message-State: AOAM530FEKpeU1g3LEQAPmnFte5NYo6RQE1T1miAfeW2EFsFbO1GZ82Z CVFtgHO19BaEbvFjwqBQmTHjTQVVIwxVfAFQ+hQL86a0E54rMU2aOuYMFsRsizevqJ5P234YRvR c6pSoRQRh3kLH0WaijMw= X-Received: by 2002:a05:6512:3204:b0:472:4792:e29c with SMTP id d4-20020a056512320400b004724792e29cmr11871270lfe.553.1652687751732; Mon, 16 May 2022 00:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/kCezXWlnpY+Y1ODT2ViwWTidttWAfliKra74WxGECHK+PWGmTZNEKsl14jl3yVAb/bvvUEwWvSPj4e0HhE0= X-Received: by 2002:a05:6512:3204:b0:472:4792:e29c with SMTP id d4-20020a056512320400b004724792e29cmr11871255lfe.553.1652687751460; Mon, 16 May 2022 00:55:51 -0700 (PDT) MIME-Version: 1.0 References: <20220512121958.2491-1-taoyunxiang@cmss.chinamobile.com> In-Reply-To: <20220512121958.2491-1-taoyunxiang@cmss.chinamobile.com> From: David Marchand Date: Mon, 16 May 2022 09:55:40 +0200 Message-ID: Subject: Re: [PATCH] bus: fix code unused To: taoyunxiang Cc: dev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, May 16, 2022 at 9:38 AM taoyunxiang 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 > Signed-off-by: Tao YunXiang > > --- > 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