The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Matthew Garrett <matthew.garrett@nebula.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kishon@ti.com
Subject: Re: [PATCH V2] net/dt: Add support for overriding phy configuration from device tree
Date: Thu, 16 Jan 2014 16:16:46 +0100	[thread overview]
Message-ID: <7510122.cayuQ6qt8r@wuerfel> (raw)
In-Reply-To: <1389883631-1480-1-git-send-email-matthew.garrett@nebula.com>

On Thursday 16 January 2014 09:47:11 Matthew Garrett wrote:
> +               if (!of_property_read_u32(np, "phy-mii-advertise-10half",
> +                                          &tmp)) {
> +                       if (tmp) {
> +                               *val |= ADVERTISE_10HALF;
> +                               phydev->advertising |= SUPPORTED_10baseT_Half;
> +                       } else {
> +                               phydev->advertising &=
> +                                       ~(SUPPORTED_10baseT_Half);
> +                       }
> +
> +                       *mask |= ADVERTISE_10HALF;
> +               }
> +               if (!of_property_read_u32(np, "phy-mii-advertise-10full",
> +                                          &tmp)) {
> +                       if (tmp) {
> +                               *val |= ADVERTISE_10FULL;
> +                               phydev->advertising |= SUPPORTED_10baseT_Full;
> +                       } else {
> +                               phydev->advertising &=
> +                                       ~(SUPPORTED_10baseT_Full);
> +                       }
> +
> +                       *mask |= ADVERTISE_10FULL;
> +               }
> 

Just a style suggestion: rather than almost duplicating the same 12 lines
of code for each property, I think it can be split out into a helper
function.

	Arnd


  reply	other threads:[~2014-01-16 15:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 21:38 [PATCH] net/dt: Add support for overriding phy configuration from device tree Matthew Garrett
2014-01-16 13:59 ` Gerhard Sittig
2014-01-16 14:40   ` Matthew Garrett
2014-01-16 14:47   ` [PATCH V2] " Matthew Garrett
2014-01-16 15:16     ` Arnd Bergmann [this message]
     [not found]       ` < 1389999459-9483-1-git-send-email-matthew.garrett@nebula.com>
2014-01-17 22:57       ` [PATCH V3] " Matthew Garrett
2014-01-19 15:34         ` Ben Hutchings
2014-02-04 19:01           ` Florian Fainelli
2014-02-04 17:15         ` Grant Likely
2014-02-04 20:39         ` Florian Fainelli
2014-02-04 21:40           ` Ben Hutchings
2014-02-04 22:48             ` Florian Fainelli
2014-02-05  9:47           ` Grant Likely
2014-02-05  9:51           ` David Laight
2014-02-07 22:43             ` Florian Fainelli
2014-02-10 16:14           ` Gerlando Falauto
2014-02-10 17:09             ` Florian Fainelli
2014-02-11  9:09               ` Gerlando Falauto
2014-02-11 17:43                 ` Florian Fainelli
2014-02-12  8:57                   ` Gerlando Falauto
2014-07-10 12:37         ` Gerlando Falauto
2014-07-22 23:40           ` Florian Fainelli

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=7510122.cayuQ6qt8r@wuerfel \
    --to=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.garrett@nebula.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox