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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230509105847.qow6jmmfub3ynfzs@soft-dev3-1>
Date: Tue, 9 May 2023 12:58:47 +0200
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: wuych <yunchuan@...china.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
	<andrew@...n.ch>, <michael@...le.cc>, <zhaoxiao@...ontech.com>,
	<andrew@...id.au>, <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH net-next] freescale:Remove unnecessary (void*) conversions

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@...china.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ