Netdev List
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: wuych <yunchuan@nfschina.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
	<andrew@lunn.ch>, <michael@walle.cc>, <zhaoxiao@uniontech.com>,
	<andrew@aj.id.au>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH net-next] freescale:Remove unnecessary (void*) conversions
Date: Tue, 9 May 2023 12:58:47 +0200	[thread overview]
Message-ID: <20230509105847.qow6jmmfub3ynfzs@soft-dev3-1> (raw)
In-Reply-To: <20230509102501.41685-1-yunchuan@nfschina.com>

The 05/09/2023 18:25, wuych wrote:

Hi wuych,

> 
> Pointer variables of void * type do not require type cast.
> 
> Signed-off-by: wuych <yunchuan@nfschina.com>
> ---
>  drivers/net/ethernet/freescale/xgmac_mdio.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
> index a13b4ba4d6e1..167a7fe04853 100644
> --- a/drivers/net/ethernet/freescale/xgmac_mdio.c
> +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
> @@ -131,7 +131,7 @@ static int xgmac_wait_until_done(struct device *dev,
>  static int xgmac_mdio_write_c22(struct mii_bus *bus, int phy_id, int regnum,
>                                 u16 value)
>  {
> -       struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv;
> +       struct mdio_fsl_priv *priv = bus->priv;

Don't forget to use the reverse x-mas notation.
The longer lines should be at top.
The same applies to the other changes that you have done in this patch.

>         struct tgec_mdio_controller __iomem *regs = priv->mdio_base;
>         bool endian = priv->is_little_endian;
>         u16 dev_addr = regnum & 0x1f;
> @@ -163,7 +163,7 @@ static int xgmac_mdio_write_c22(struct mii_bus *bus, int phy_id, int regnum,
>  static int xgmac_mdio_write_c45(struct mii_bus *bus, int phy_id, int dev_addr,
>                                 int regnum, u16 value)
>  {
> -       struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv;
> +       struct mdio_fsl_priv *priv = bus->priv;
>         struct tgec_mdio_controller __iomem *regs = priv->mdio_base;
>         bool endian = priv->is_little_endian;
>         u32 mdio_ctl, mdio_stat;
> @@ -205,7 +205,7 @@ static int xgmac_mdio_write_c45(struct mii_bus *bus, int phy_id, int dev_addr,
>   */
>  static int xgmac_mdio_read_c22(struct mii_bus *bus, int phy_id, int regnum)
>  {
> -       struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv;
> +       struct mdio_fsl_priv *priv = bus->priv;
>         struct tgec_mdio_controller __iomem *regs = priv->mdio_base;
>         bool endian = priv->is_little_endian;
>         u16 dev_addr = regnum & 0x1f;
> @@ -265,7 +265,7 @@ static int xgmac_mdio_read_c22(struct mii_bus *bus, int phy_id, int regnum)
>  static int xgmac_mdio_read_c45(struct mii_bus *bus, int phy_id, int dev_addr,
>                                int regnum)
>  {
> -       struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv;
> +       struct mdio_fsl_priv *priv = bus->priv;
>         struct tgec_mdio_controller __iomem *regs = priv->mdio_base;
>         bool endian = priv->is_little_endian;
>         u32 mdio_stat, mdio_ctl;
> @@ -326,7 +326,7 @@ static int xgmac_mdio_read_c45(struct mii_bus *bus, int phy_id, int dev_addr,
> 
>  static int xgmac_mdio_set_mdc_freq(struct mii_bus *bus)
>  {
> -       struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv;
> +       struct mdio_fsl_priv *priv = bus->priv;
>         struct tgec_mdio_controller __iomem *regs = priv->mdio_base;
>         struct device *dev = bus->parent;
>         u32 mdio_stat, div;
> @@ -355,7 +355,7 @@ static int xgmac_mdio_set_mdc_freq(struct mii_bus *bus)
> 
>  static void xgmac_mdio_set_suppress_preamble(struct mii_bus *bus)
>  {
> -       struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv;
> +       struct mdio_fsl_priv *priv = bus->priv;
>         struct tgec_mdio_controller __iomem *regs = priv->mdio_base;
>         struct device *dev = bus->parent;
>         u32 mdio_stat;
> --
> 2.30.2
> 
> 

-- 
/Horatiu

  reply	other threads:[~2023-05-09 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 10:25 [PATCH net-next] freescale:Remove unnecessary (void*) conversions wuych
2023-05-09 10:58 ` Horatiu Vultur [this message]
2023-05-09 12:04 ` Andrew Lunn

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=20230509105847.qow6jmmfub3ynfzs@soft-dev3-1 \
    --to=horatiu.vultur@microchip.com \
    --cc=andrew@aj.id.au \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yunchuan@nfschina.com \
    --cc=zhaoxiao@uniontech.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