All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atlantic: Remove unnecessary (void*) conversions
@ 2023-05-04 10:02 wuych
  2023-05-04 11:03 ` Leon Romanovsky
  2023-05-04 15:34 ` Simon Horman
  0 siblings, 2 replies; 4+ messages in thread
From: wuych @ 2023-05-04 10:02 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, irusskikh; +Cc: netdev, kernel-janitors, wuych

Pointer variables of void * type do not require type cast.

Signed-off-by: wuych <yunchuan@nfschina.com>
---
 .../net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
index 5dfc751572ed..b0f527b04c97 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
@@ -93,7 +93,7 @@ static u32 hw_atl2_sem_act_rslvr_get(struct aq_hw_s *self)
 
 static int hw_atl2_hw_reset(struct aq_hw_s *self)
 {
-	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
+	struct hw_atl2_priv *priv = self->priv;
 	int err;
 
 	err = hw_atl2_utils_soft_reset(self);
@@ -378,7 +378,7 @@ static int hw_atl2_hw_init_tx_path(struct aq_hw_s *self)
 
 static void hw_atl2_hw_init_new_rx_filters(struct aq_hw_s *self)
 {
-	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
+	struct hw_atl2_priv *priv = self->priv;
 	u8 *prio_tc_map = self->aq_nic_cfg->prio_tc_map;
 	u16 action;
 	u8 index;
@@ -433,7 +433,7 @@ static void hw_atl2_hw_new_rx_filter_vlan_promisc(struct aq_hw_s *self,
 	u16 off_action = (!promisc &&
 			  !hw_atl_rpfl2promiscuous_mode_en_get(self)) ?
 				HW_ATL2_ACTION_DROP : HW_ATL2_ACTION_DISABLE;
-	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
+	struct hw_atl2_priv *priv = self->priv;
 	u8 index;
 
 	index = priv->art_base_index + HW_ATL2_RPF_VLAN_PROMISC_OFF_INDEX;
@@ -445,7 +445,7 @@ static void hw_atl2_hw_new_rx_filter_vlan_promisc(struct aq_hw_s *self,
 static void hw_atl2_hw_new_rx_filter_promisc(struct aq_hw_s *self, bool promisc)
 {
 	u16 off_action = promisc ? HW_ATL2_ACTION_DISABLE : HW_ATL2_ACTION_DROP;
-	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
+	struct hw_atl2_priv *priv = self->priv;
 	bool vlan_promisc_enable;
 	u8 index;
 
@@ -539,7 +539,7 @@ static int hw_atl2_hw_init(struct aq_hw_s *self, const u8 *mac_addr)
 		[AQ_HW_IRQ_MSIX]    = { 0x20000022U, 0x20000026U },
 	};
 
-	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
+	struct hw_atl2_priv *priv = self->priv;
 	struct aq_nic_cfg_s *aq_nic_cfg = self->aq_nic_cfg;
 	u8 base_index, count;
 	int err;
@@ -770,7 +770,7 @@ static struct aq_stats_s *hw_atl2_utils_get_hw_stats(struct aq_hw_s *self)
 static int hw_atl2_hw_vlan_set(struct aq_hw_s *self,
 			       struct aq_rx_filter_vlan *aq_vlans)
 {
-	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
+	struct hw_atl2_priv *priv = self->priv;
 	u32 queue;
 	u8 index;
 	int i;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] atlantic: Remove unnecessary (void*) conversions
  2023-05-04 10:02 [PATCH] atlantic: Remove unnecessary (void*) conversions wuych
@ 2023-05-04 11:03 ` Leon Romanovsky
  2023-05-04 11:39   ` Paolo Abeni
  2023-05-04 15:34 ` Simon Horman
  1 sibling, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2023-05-04 11:03 UTC (permalink / raw)
  To: wuych; +Cc: davem, edumazet, kuba, pabeni, irusskikh, netdev, kernel-janitors

On Thu, May 04, 2023 at 06:02:53PM +0800, wuych wrote:
> Pointer variables of void * type do not require type cast.
> 
> Signed-off-by: wuych <yunchuan@nfschina.com>
> ---
>  .../net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

There is same thing in drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c too.

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] atlantic: Remove unnecessary (void*) conversions
  2023-05-04 11:03 ` Leon Romanovsky
@ 2023-05-04 11:39   ` Paolo Abeni
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2023-05-04 11:39 UTC (permalink / raw)
  To: Leon Romanovsky, wuych
  Cc: davem, edumazet, kuba, irusskikh, netdev, kernel-janitors

On Thu, 2023-05-04 at 14:03 +0300, Leon Romanovsky wrote:
> On Thu, May 04, 2023 at 06:02:53PM +0800, wuych wrote:
> > Pointer variables of void * type do not require type cast.
> > 
> > Signed-off-by: wuych <yunchuan@nfschina.com>
> > ---
> >  .../net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> There is same thing in drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c too.

Also this looks like material for net-next: the next version will have
to wait a bit, see below.

Next time please include the target tree into the email subj, thanks!

## Form letter - net-next-closed

The merge window for v6.3 has begun and therefore net-next is closed
for new drivers, features, code refactoring and optimizations.
We are currently accepting bug fixes only.

Please repost when net-next reopens after May 8th.

RFC patches sent for review only are obviously welcome at any time.

See:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] atlantic: Remove unnecessary (void*) conversions
  2023-05-04 10:02 [PATCH] atlantic: Remove unnecessary (void*) conversions wuych
  2023-05-04 11:03 ` Leon Romanovsky
@ 2023-05-04 15:34 ` Simon Horman
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-05-04 15:34 UTC (permalink / raw)
  To: wuych; +Cc: davem, edumazet, kuba, pabeni, irusskikh, netdev, kernel-janitors

On Thu, May 04, 2023 at 06:02:53PM +0800, wuych wrote:
> Pointer variables of void * type do not require type cast.
> 
> Signed-off-by: wuych <yunchuan@nfschina.com>

...

> @@ -378,7 +378,7 @@ static int hw_atl2_hw_init_tx_path(struct aq_hw_s *self)
>  
>  static void hw_atl2_hw_init_new_rx_filters(struct aq_hw_s *self)
>  {
> -	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
> +	struct hw_atl2_priv *priv = self->priv;
>  	u8 *prio_tc_map = self->aq_nic_cfg->prio_tc_map;
>  	u16 action;
>  	u8 index;

While you are here, and seeing as you need to repost this for net-next
anyway: could you adjust the order of the lines above to observe reverse
xmas tree - longest line to shortest - for local variable declarations
in networking code?

...

> @@ -539,7 +539,7 @@ static int hw_atl2_hw_init(struct aq_hw_s *self, const u8 *mac_addr)
>  		[AQ_HW_IRQ_MSIX]    = { 0x20000022U, 0x20000026U },
>  	};
>  
> -	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
> +	struct hw_atl2_priv *priv = self->priv;
>  	struct aq_nic_cfg_s *aq_nic_cfg = self->aq_nic_cfg;
>  	u8 base_index, count;
>  	int err;

Ditto.

...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-04 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 10:02 [PATCH] atlantic: Remove unnecessary (void*) conversions wuych
2023-05-04 11:03 ` Leon Romanovsky
2023-05-04 11:39   ` Paolo Abeni
2023-05-04 15:34 ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.