diff mbox series

drivers: broadcom: save return value of pci_find_capability() in u8

Message ID 20201206201033.21823-1-puranjay12@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series drivers: broadcom: save return value of pci_find_capability() in u8 | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 12 this patch: 12
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 12 this patch: 12
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Puranjay Mohan Dec. 6, 2020, 8:10 p.m. UTC
Callers of pci_find_capability() should save the return value in u8.
change the type of pcix_cap from int to u8, to match the specification.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
---
 drivers/net/ethernet/broadcom/tg3.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bjorn Helgaas Dec. 7, 2020, 11 p.m. UTC | #1
On Mon, Dec 07, 2020 at 01:40:33AM +0530, Puranjay Mohan wrote:
> Callers of pci_find_capability() should save the return value in u8.
> change the type of pcix_cap from int to u8, to match the specification.
> 
> Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/tg3.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
> index 1000c894064f..f1781d2dce0b 100644
> --- a/drivers/net/ethernet/broadcom/tg3.h
> +++ b/drivers/net/ethernet/broadcom/tg3.h
> @@ -3268,7 +3268,7 @@ struct tg3 {
>  
>  	int				pci_fn;
>  	int				msi_cap;
> -	int				pcix_cap;
> +	u8				pcix_cap;

msi_cap is also a u8.

But I don't think it's worth changing either of these unless we take a
broader look and see whether they're needed at all.

msi_cap is used to restore the MSI enable bit after a highly
device-specific reset.

pcix_cap is used for some PCI-X configuration that really should be
done via pcix_set_mmrbc() and possibly some sort of quirk for
PCI_X_CMD_MAX_SPLIT.

But that's all pretty messy and I doubt it's worth doing it at this
point, since PCI-X is pretty much ancient history.

>  	int				pcie_readrq;
>  
>  	struct mii_bus			*mdio_bus;
> -- 
> 2.27.0
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 1000c894064f..f1781d2dce0b 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -3268,7 +3268,7 @@  struct tg3 {
 
 	int				pci_fn;
 	int				msi_cap;
-	int				pcix_cap;
+	u8				pcix_cap;
 	int				pcie_readrq;
 
 	struct mii_bus			*mdio_bus;