lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53C41511.5090204@cogentembedded.com>
Date:	Mon, 14 Jul 2014 21:36:17 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	varkabhadram@...il.com, netdev@...r.kernel.org
CC:	Thomas.Lendacky@....com, geert+renesas@...ux-m68k.org,
	ebiederm@...ssion.com, macro@...ux-mips.org,
	linux-kernel@...r.kernel.org, davem@...emloft.net,
	Varka Bhadram <varkab@...c.in>
Subject: Re: [PATCH net-next v2 5/6] ethernet: amd: fix pci device ids

Hello.

On 07/14/2014 10:25 AM, varkabhadram@...il.com wrote:

> From: Varka Bhadram <varkab@...c.in>

> Normally any device ids will be above the corresponding device driver
> structure. This patch moves the pci device ids and MODULE_DEVICE_TABLE()
> above the pci driver structure.

> Signed-off-by: Varka Bhadram <varkab@...c.in>
> ---
>   drivers/net/ethernet/amd/amd8111e.c |   20 +++++++++++---------
>   1 file changed, 11 insertions(+), 9 deletions(-)

> diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
> index e2fb9e2..3e41568 100644
> --- a/drivers/net/ethernet/amd/amd8111e.c
> +++ b/drivers/net/ethernet/amd/amd8111e.c
[...]
> @@ -109,14 +108,6 @@ MODULE_PARM_DESC(coalesce, "Enable or Disable interrupt coalescing, 1: Enable, 0
>   module_param_array(dynamic_ipg, bool, NULL, 0);
>   MODULE_PARM_DESC(dynamic_ipg, "Enable or Disable dynamic IPG, 1: Enable, 0: Disable");
>
> -static DEFINE_PCI_DEVICE_TABLE(amd8111e_pci_tbl) = {
> -
> -	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD8111E_7462,
> -	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> -	{ 0, }
> -
> -};
> -
>   /* This function will read the PHY registers. */
>   static int amd8111e_read_phy(struct amd8111e_priv* lp, int phy_id, int reg, u32* val)
>   {
> @@ -1953,6 +1944,17 @@ static void amd8111e_remove_one(struct pci_dev *pdev)
>   	}
>   }
>
> +static const struct pci_device_id amd8111e_pci_tbl[] = {
> +	{
> +	 .vendor = PCI_VENDOR_ID_AMD,
> +	 .device = PCI_DEVICE_ID_AMD8111E_7462,

    I don't that's equivalent to what was there before: PCI_ANY_ID is defined 
as (~0), not 0.

> +	},
> +	{
> +	 .vendor = 0,

    You can completely skip the explicit initializers, the entry will be 
init'ed with 0s anyway.

> +	}
> +};
> +MODULE_DEVICE_TABLE(pci, amd8111e_pci_tbl);
> +

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ