* [PATCH] drivers: infiniband: save return value of pci_find_capability() in u8
@ 2020-12-06 19:51 Puranjay Mohan
2020-12-07 23:19 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Puranjay Mohan @ 2020-12-06 19:51 UTC (permalink / raw)
To: dledford, jgg, linux-rdma, bjorn, linux-pci; +Cc: Puranjay Mohan
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;
u16 devctl;
u16 linkctl;
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers: infiniband: save return value of pci_find_capability() in u8
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
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2020-12-07 23:19 UTC (permalink / raw)
To: Puranjay Mohan; +Cc: dledford, jgg, linux-rdma, bjorn, linux-pci
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-07 23:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).