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
| ||
|
Message-ID: <9a0753a2-eb4d-5f9f-34a8-f1774593c28d@siemens.com> Date: Sun, 28 May 2017 18:52:40 +0200 From: Jan Kiszka <jan.kiszka@...mens.com> To: Andy Shevchenko <andy.shevchenko@...il.com> Cc: Giuseppe Cavallaro <peppe.cavallaro@...com>, Alexandre Torgue <alexandre.torgue@...com>, David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org> Subject: Re: [PATCH v2 5/6] stmmac: pci: Use dmi_system_id table for retrieving PHY addresses On 2017-05-27 15:28, Andy Shevchenko wrote: > On Fri, May 26, 2017 at 7:07 PM, Jan Kiszka <jan.kiszka@...mens.com> wrote: >> Avoids reimplementation of DMI matching in stmmac_pci_find_phy_addr. > >> struct stmmac_pci_dmi_data { >> - const char *name; >> - const char *asset_tag; >> - unsigned int func; >> + int func; >> int phy_addr; >> }; > > Can we leave unsigned type here... > >> -static struct stmmac_pci_dmi_data quark_pci_dmi_data[] = { >> +static const struct stmmac_pci_dmi_data galileo_stmmac_dmi_data[] = { > >> + {-1, -1}, >> +}; > >> +static const struct stmmac_pci_dmi_data iot2040_stmmac_dmi_data[] = { > >> + {-1, -1}, >> +}; > > ...and avoid this not so standard terminators? 0 is a valid PCI function, thus can't be use as terminator. Therefore I chose -1 as an obviously invalid value. > >> + .matches = { >> + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"), >> + }, > >> + .driver_data = (void *)galileo_stmmac_dmi_data, > > Can't be slightly better > > .driver_data = &galileo_stmmac_dmi_data, > > ? > Interesting, that removes the "const" as well. OK. Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux
Powered by blists - more mailing lists