From: Weili Qian <qianweili@huawei.com>
To: Chen Ni <nichen@iscas.ac.cn>, <wangzhou1@hisilicon.com>,
<herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<xuzaibo@huawei.com>, <tanshukun1@huawei.com>
Cc: <linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] crypto: hisilicon - Add check for pci_find_ext_capability
Date: Fri, 17 Nov 2023 10:07:00 +0800 [thread overview]
Message-ID: <6eeced40-7951-ca0d-1bcd-62e1d329ca96@huawei.com> (raw)
In-Reply-To: <20231109021308.1859881-1-nichen@iscas.ac.cn>
On 2023/11/9 10:13, Chen Ni wrote:
> Add check for pci_find_ext_capability() and return the error if it
> fails in order to transfer the error.
>
> Fixes: 6c6dd5802c2d ("crypto: hisilicon/qm - add controller reset interface")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
> drivers/crypto/hisilicon/qm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
> index 18599f3634c3..adbab1286d4a 100644
> --- a/drivers/crypto/hisilicon/qm.c
> +++ b/drivers/crypto/hisilicon/qm.c
> @@ -3967,6 +3967,9 @@ static int qm_set_vf_mse(struct hisi_qm *qm, bool set)
> int i;
>
> pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
> + if (!pos)
> + return -ENODEV;
> +
Thanks for your patch. The function qm_set_vf_mse() is called only after SRIOV
is enabled, so function pci_find_ext_capability() does not return 0. This check
makes no sense.
Thanks,
Weili
> pci_read_config_word(pdev, pos + PCI_SRIOV_CTRL, &sriov_ctrl);
> if (set)
> sriov_ctrl |= PCI_SRIOV_CTRL_MSE;
>
next prev parent reply other threads:[~2023-11-17 2:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 2:13 Chen Ni
2023-11-17 2:07 ` Weili Qian [this message]
2023-11-17 10:36 ` Herbert Xu
2023-11-22 12:11 ` Weili Qian
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=6eeced40-7951-ca0d-1bcd-62e1d329ca96@huawei.com \
--to=qianweili@huawei.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=tanshukun1@huawei.com \
--cc=wangzhou1@hisilicon.com \
--cc=xuzaibo@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®