* [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions
@ 2023-05-15 8:49 wuych
2023-05-15 9:28 ` Dan Carpenter
0 siblings, 1 reply; 6+ messages in thread
From: wuych @ 2023-05-15 8:49 UTC (permalink / raw)
To: dchickles, sburla, fmanlunas, davem, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, kernel-janitors, wuych
Pointer variables of void * type do not require type cast.
Signed-off-by: wuych <yunchuan@nfschina.com>
---
drivers/net/ethernet/cavium/liquidio/lio_core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
index 882b2be06ea0..10d9dab26c92 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
@@ -904,8 +904,7 @@ static
int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
{
struct octeon_device *oct = droq->oct_dev;
- struct octeon_device_priv *oct_priv =
- (struct octeon_device_priv *)oct->priv;
+ struct octeon_device_priv *oct_priv = oct->priv;
if (droq->ops.poll_mode) {
droq->ops.napi_fn(droq);
@@ -947,8 +946,7 @@ liquidio_msix_intr_handler(int __maybe_unused irq, void *dev)
*/
static void liquidio_schedule_droq_pkt_handlers(struct octeon_device *oct)
{
- struct octeon_device_priv *oct_priv =
- (struct octeon_device_priv *)oct->priv;
+ struct octeon_device_priv *oct_priv = oct->priv;
struct octeon_droq *droq;
u64 oq_no;
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions
2023-05-15 8:49 [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions wuych
@ 2023-05-15 9:28 ` Dan Carpenter
2023-05-15 14:56 ` Dan Carpenter
0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2023-05-15 9:28 UTC (permalink / raw)
To: wuych
Cc: dchickles, sburla, fmanlunas, davem, edumazet, kuba, pabeni,
netdev, linux-kernel, kernel-janitors
On Mon, May 15, 2023 at 04:49:06PM +0800, wuych wrote:
> Pointer variables of void * type do not require type cast.
>
> Signed-off-by: wuych <yunchuan@nfschina.com>
> ---
> drivers/net/ethernet/cavium/liquidio/lio_core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
> index 882b2be06ea0..10d9dab26c92 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
> @@ -904,8 +904,7 @@ static
> int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
> {
> struct octeon_device *oct = droq->oct_dev;
> - struct octeon_device_priv *oct_priv =
> - (struct octeon_device_priv *)oct->priv;
> + struct octeon_device_priv *oct_priv = oct->priv;
>
Networking code needs to be in Reverse Christmas Tree order. Longest
lines first. This code wasn't really in Reverse Christmas Tree order
to begine with but now it's more obvious.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions
2023-05-15 9:28 ` Dan Carpenter
@ 2023-05-15 14:56 ` Dan Carpenter
2023-05-15 20:19 ` Simon Horman
0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2023-05-15 14:56 UTC (permalink / raw)
To: wuych
Cc: dchickles, sburla, fmanlunas, davem, edumazet, kuba, pabeni,
netdev, linux-kernel, kernel-janitors
On Mon, May 15, 2023 at 12:28:19PM +0300, Dan Carpenter wrote:
> On Mon, May 15, 2023 at 04:49:06PM +0800, wuych wrote:
> > Pointer variables of void * type do not require type cast.
> >
> > Signed-off-by: wuych <yunchuan@nfschina.com>
> > ---
> > drivers/net/ethernet/cavium/liquidio/lio_core.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
> > index 882b2be06ea0..10d9dab26c92 100644
> > --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
> > +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
> > @@ -904,8 +904,7 @@ static
> > int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
> > {
> > struct octeon_device *oct = droq->oct_dev;
> > - struct octeon_device_priv *oct_priv =
> > - (struct octeon_device_priv *)oct->priv;
> > + struct octeon_device_priv *oct_priv = oct->priv;
> >
>
> Networking code needs to be in Reverse Christmas Tree order. Longest
> lines first. This code wasn't really in Reverse Christmas Tree order
> to begine with but now it's more obvious.
Oh, duh. This obviously can't be reversed because it depends on the
first declaration. Sorry for the noise.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions
2023-05-15 14:56 ` Dan Carpenter
@ 2023-05-15 20:19 ` Simon Horman
2023-05-17 3:20 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2023-05-15 20:19 UTC (permalink / raw)
To: Dan Carpenter
Cc: wuych, dchickles, sburla, fmanlunas, davem, edumazet, kuba,
pabeni, netdev, linux-kernel, kernel-janitors
On Mon, May 15, 2023 at 05:56:21PM +0300, Dan Carpenter wrote:
> On Mon, May 15, 2023 at 12:28:19PM +0300, Dan Carpenter wrote:
> > On Mon, May 15, 2023 at 04:49:06PM +0800, wuych wrote:
> > > Pointer variables of void * type do not require type cast.
> > >
> > > Signed-off-by: wuych <yunchuan@nfschina.com>
> > > ---
> > > drivers/net/ethernet/cavium/liquidio/lio_core.c | 6 ++----
> > > 1 file changed, 2 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
> > > index 882b2be06ea0..10d9dab26c92 100644
> > > --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
> > > +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
> > > @@ -904,8 +904,7 @@ static
> > > int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
> > > {
> > > struct octeon_device *oct = droq->oct_dev;
> > > - struct octeon_device_priv *oct_priv =
> > > - (struct octeon_device_priv *)oct->priv;
> > > + struct octeon_device_priv *oct_priv = oct->priv;
> > >
> >
> > Networking code needs to be in Reverse Christmas Tree order. Longest
> > lines first. This code wasn't really in Reverse Christmas Tree order
> > to begine with but now it's more obvious.
>
> Oh, duh. This obviously can't be reversed because it depends on the
> first declaration. Sorry for the noise.
FWIIW, I think the preferred approach for such cases is to
separate the declaration and initialisation. Something like:
struct octeon_device *oct = droq->oct_dev;
struct octeon_device_priv *oct_priv;
oct_priv = oct->priv;
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions
2023-05-15 20:19 ` Simon Horman
@ 2023-05-17 3:20 ` Jakub Kicinski
2023-05-17 9:35 ` Simon Horman
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2023-05-17 3:20 UTC (permalink / raw)
To: Simon Horman
Cc: Dan Carpenter, wuych, dchickles, sburla, fmanlunas, davem,
edumazet, pabeni, netdev, linux-kernel, kernel-janitors
On Mon, 15 May 2023 22:19:31 +0200 Simon Horman wrote:
> On Mon, May 15, 2023 at 05:56:21PM +0300, Dan Carpenter wrote:
> > On Mon, May 15, 2023 at 12:28:19PM +0300, Dan Carpenter wrote:
> > > Networking code needs to be in Reverse Christmas Tree order. Longest
> > > lines first. This code wasn't really in Reverse Christmas Tree order
> > > to begine with but now it's more obvious.
> >
> > Oh, duh. This obviously can't be reversed because it depends on the
> > first declaration. Sorry for the noise.
>
> FWIIW, I think the preferred approach for such cases is to
> separate the declaration and initialisation. Something like:
>
> struct octeon_device *oct = droq->oct_dev;
> struct octeon_device_priv *oct_priv;
>
> oct_priv = oct->priv;
I don't think these changes are worth bothering with at all, TBH.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions
2023-05-17 3:20 ` Jakub Kicinski
@ 2023-05-17 9:35 ` Simon Horman
0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2023-05-17 9:35 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Dan Carpenter, wuych, dchickles, sburla, fmanlunas, davem,
edumazet, pabeni, netdev, linux-kernel, kernel-janitors
On Tue, May 16, 2023 at 08:20:59PM -0700, Jakub Kicinski wrote:
> On Mon, 15 May 2023 22:19:31 +0200 Simon Horman wrote:
> > On Mon, May 15, 2023 at 05:56:21PM +0300, Dan Carpenter wrote:
> > > On Mon, May 15, 2023 at 12:28:19PM +0300, Dan Carpenter wrote:
> > > > Networking code needs to be in Reverse Christmas Tree order. Longest
> > > > lines first. This code wasn't really in Reverse Christmas Tree order
> > > > to begine with but now it's more obvious.
> > >
> > > Oh, duh. This obviously can't be reversed because it depends on the
> > > first declaration. Sorry for the noise.
> >
> > FWIIW, I think the preferred approach for such cases is to
> > separate the declaration and initialisation. Something like:
> >
> > struct octeon_device *oct = droq->oct_dev;
> > struct octeon_device_priv *oct_priv;
> >
> > oct_priv = oct->priv;
>
> I don't think these changes are worth bothering with at all, TBH.
Understood.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-05-17 9:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-15 8:49 [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions wuych
2023-05-15 9:28 ` Dan Carpenter
2023-05-15 14:56 ` Dan Carpenter
2023-05-15 20:19 ` Simon Horman
2023-05-17 3:20 ` Jakub Kicinski
2023-05-17 9:35 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).