netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Zach Brown" <zach.brown@ni.com>,
	"Volodymyr Bendiuga" <volodymyr.bendiuga@gmail.com>,
	"Magnus Öberg" <magnus.oberg@westermo.se>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: phy: leds: Fix truncated LED trigger names
Date: Tue, 24 Jan 2017 21:03:39 +0100	[thread overview]
Message-ID: <20170124200339.GT10895@lunn.ch> (raw)
In-Reply-To: <1485272470-3497-3-git-send-email-geert+renesas@glider.be>

> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 5c9d2529685fe215..f6ab919528ab3627 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -25,7 +25,6 @@
>  #include <linux/timer.h>
>  #include <linux/workqueue.h>
>  #include <linux/mod_devicetable.h>
> -#include <linux/phy_led_triggers.h>
>  
>  #include <linux/atomic.h>
>  
> @@ -339,6 +338,8 @@ struct phy_c45_device_ids {
>  	u32 device_ids[8];
>  };
>  
> +#include <linux/phy_led_triggers.h>
> +
>  /* phy_device: An instance of a PHY
>   *
>   * drv: Pointer to the driver for this PHY instance
> diff --git a/include/linux/phy_led_triggers.h b/include/linux/phy_led_triggers.h
> index a2daea0a37d2ae14..69dffb4fc5a294e9 100644
> --- a/include/linux/phy_led_triggers.h
> +++ b/include/linux/phy_led_triggers.h
> @@ -20,9 +20,8 @@
>  #include <linux/leds.h>
>  
>  #define PHY_LED_TRIGGER_SPEED_SUFFIX_SIZE	10
> -#define PHY_MII_BUS_ID_SIZE	(20 - 3)
>  
> -#define PHY_LINK_LED_TRIGGER_NAME_SIZE (PHY_MII_BUS_ID_SIZE + \
> +#define PHY_LINK_LED_TRIGGER_NAME_SIZE (MII_BUS_ID_SIZE + \
>  				       FIELD_SIZEOF(struct mdio_device, addr)+\
>  				       PHY_LED_TRIGGER_SPEED_SUFFIX_SIZE)

Hi Geert

Using the macro is great, but it does seem a bit ugly having the
include in the middle of the file.

As far as i can see, phy.h only uses a pointer to a struct
phy_led_trigger, not struct phy_led_trigger itself. Could you try
removing the header file all together and just have a forward
declaration of phy_led_trigger?

Thanks
	Andrew

  reply	other threads:[~2017-01-24 20:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 15:41 [PATCH 0/2] net: phy: leds: Fix truncated LED trigger names and crashes Geert Uytterhoeven
2017-01-24 15:41 ` [PATCH 1/2] net: phy: leds: Clear phy_num_led_triggers on failure to avoid crash Geert Uytterhoeven
2017-01-24 20:52   ` Florian Fainelli
2017-01-24 15:41 ` [PATCH 2/2] net: phy: leds: Fix truncated LED trigger names Geert Uytterhoeven
2017-01-24 20:03   ` Andrew Lunn [this message]
2017-01-25  9:56     ` Geert Uytterhoeven

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=20170124200339.GT10895@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.oberg@westermo.se \
    --cc=netdev@vger.kernel.org \
    --cc=volodymyr.bendiuga@gmail.com \
    --cc=zach.brown@ni.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).