Message ID | 20230509102501.41685-1-yunchuan@nfschina.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] freescale:Remove unnecessary (void*) conversions | expand |
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 > >
On Tue, May 09, 2023 at 06:25:01PM +0800, wuych wrote: > Pointer variables of void * type do not require type cast. > > Signed-off-by: wuych <yunchuan@nfschina.com> Hi Wuych Please be a bit more specific with your subject prefix. To get an idea what others have used, you can do: git log --oneline drivers/net/ethernet/freescale/ c248b27cfc0a Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net e2fdfd711912 net: dpaa: avoid one skb_reset_mac_header() in dpaa_enable_tx_csum() 461bb5b97049 net: dpaa: Fix uninitialized variable in dpaa_stop() 16a2c7634442 net: enetc: include MAC Merge / FP registers in register dump 827145392a4a net: enetc: only commit preemptible TCs to hardware when MM TX is active 153b5b1d030d net: enetc: report mm tx-active based on tx-enabled and verify-status 59be75db5966 net: enetc: fix MAC Merge layer remaining enabled until a link down event 01e23b2b3bad net: enetc: add support for preemptible traffic classes 50764da37cbe net: enetc: rename "mqprio" to "qopt" 800e68c44ffe Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 5b7be2d4fd6e net: enetc: workaround for unresponsive pMAC after receiving express traffic 37f9b2a6c086 net: ethernet: Add missing depends on MDIO_DEVRES d9c960675adc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net abc33494ddd5 net: fec: make use of MDIO C45 quirk dc0a7b520071 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 99d0f3a1095f net: dpaa2-mac: use Autoneg bit rather than an_enabled c79493c3ccf0 net: enetc: fix aggregate RMON counters not showing the ranges 1a87e641d8a5 net: Use of_property_read_bool() for boolean properties 8ff99ad04c2e Merge tag 'phy-for-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy 1c93e48cc391 net: dpaa2-eth: do not always set xsk support in xdp_features flag So at least add net. And since you only touch xgmac, you could use net: xgmac: If you had touch multiple drivers within freescale then net: freescale: would be better. These prefixes are important. Reviewers tend to have interest in specific parts of the kernel. The prefix is what draws their attention, makes them look at a patch or not. Andrew
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; 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;
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(-)