All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 5/6] stmmac: pci: Use dmi_system_id table for retrieving PHY addresses
Date: Sun, 28 May 2017 18:52:40 +0200	[thread overview]
Message-ID: <9a0753a2-eb4d-5f9f-34a8-f1774593c28d@siemens.com> (raw)
In-Reply-To: <CAHp75VeLVs6LK=_=e_2B+huZLENe6V-8SMNLiEEi+4h_uqmvMg@mail.gmail.com>

On 2017-05-27 15:28, Andy Shevchenko wrote:
> On Fri, May 26, 2017 at 7:07 PM, Jan Kiszka <jan.kiszka@siemens.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

  reply	other threads:[~2017-05-28 16:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 16:07 [PATCH v2 0/6] stmmac: pci: Refactor DMI probing Jan Kiszka
2017-05-26 16:07 ` [PATCH v2 1/6] stmmac: pci: Make stmmac_pci_info structure constant Jan Kiszka
2017-05-26 16:07 ` [PATCH v2 2/6] stmmac: pci: Use stmmac_pci_info for all devices Jan Kiszka
2017-05-27 13:13   ` Andy Shevchenko
2017-05-27 13:16     ` Andy Shevchenko
2017-05-26 16:07 ` [PATCH v2 3/6] stmmac: pci: Make stmmac_pci_find_phy_addr truly generic Jan Kiszka
2017-05-27 13:25   ` Andy Shevchenko
2017-05-26 16:07 ` [PATCH v2 4/6] stmmac: pci: Select quark_pci_dmi_data from quark_default_data Jan Kiszka
2017-05-26 16:07 ` [PATCH v2 5/6] stmmac: pci: Use dmi_system_id table for retrieving PHY addresses Jan Kiszka
2017-05-27 13:28   ` Andy Shevchenko
2017-05-28 16:52     ` Jan Kiszka [this message]
2017-05-26 16:07 ` [PATCH v2 6/6] stmmac: pci: Remove setup handler indirection via stmmac_pci_info Jan Kiszka
2017-05-27 13:38   ` Andy Shevchenko
2017-05-28 16:52     ` Jan Kiszka

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=9a0753a2-eb4d-5f9f-34a8-f1774593c28d@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=alexandre.torgue@st.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.