diff mbox series

[net-next] freescale:Remove unnecessary (void*) conversions

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

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 1 maintainers not CCed: kuba@kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 48 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Wu Yunchuan May 9, 2023, 10:25 a.m. UTC
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(-)

Comments

Horatiu Vultur May 9, 2023, 10:58 a.m. UTC | #1
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
> 
>
Andrew Lunn May 9, 2023, 12:04 p.m. UTC | #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 mbox series

Patch

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;