From: Bjorn Helgaas <helgaas@kernel.org>
To: Puranjay Mohan <puranjay12@gmail.com>
Cc: dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org,
bjorn@helgaas.com, linux-pci@vger.kernel.org
Subject: Re: [PATCH] drivers: infiniband: save return value of pci_find_capability() in u8
Date: Mon, 7 Dec 2020 17:19:54 -0600 [thread overview]
Message-ID: <20201207231954.GA2311330@bjorn-Precision-5520> (raw)
In-Reply-To: <20201206195120.18413-1-puranjay12@gmail.com>
On Mon, Dec 07, 2020 at 01:21:20AM +0530, Puranjay Mohan wrote:
> Callers of pci_find_capability should save the return value in u8.
> change type of variables from int to u8 to match the specification.
>
> Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
> ---
> drivers/infiniband/hw/mthca/mthca_reset.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c
> index 2a6979e4ae1c..1b6ec870bd47 100644
> --- a/drivers/infiniband/hw/mthca/mthca_reset.c
> +++ b/drivers/infiniband/hw/mthca/mthca_reset.c
> @@ -45,9 +45,9 @@ int mthca_reset(struct mthca_dev *mdev)
> u32 *hca_header = NULL;
> u32 *bridge_header = NULL;
> struct pci_dev *bridge = NULL;
> - int bridge_pcix_cap = 0;
> + u8 bridge_pcix_cap = 0;
> int hca_pcie_cap = 0;
> - int hca_pcix_cap = 0;
> + u8 hca_pcix_cap = 0;
I don't think this is really worth changing. That mthca_reset() path
is such a mess that this is the least of the worries there. This
patch shouldn't have any risk, but I wouldn't want my fingerprints on
that function in case somebody else looks at it later ;-)
> u16 devctl;
> u16 linkctl;
> --
> 2.27.0
>
prev parent reply other threads:[~2020-12-07 23:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 19:51 [PATCH] drivers: infiniband: save return value of pci_find_capability() in u8 Puranjay Mohan
2020-12-07 23:19 ` Bjorn Helgaas [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=20201207231954.GA2311330@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=bjorn@helgaas.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=puranjay12@gmail.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