From: Simon Horman <simon.horman@corigine.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: wuych <yunchuan@nfschina.com>,
dchickles@marvell.com, sburla@marvell.com, fmanlunas@marvell.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH net-next] net: liquidio: lio_core: Remove unnecessary (void*) conversions
Date: Mon, 15 May 2023 22:19:31 +0200 [thread overview]
Message-ID: <ZGKT01kLOQNRqx9I@corigine.com> (raw)
In-Reply-To: <2c8a5e3f-965e-422a-b347-741bcc7d33ce@kili.mountain>
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;
next prev parent reply other threads:[~2023-05-15 20:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-05-17 3:20 ` Jakub Kicinski
2023-05-17 9:35 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZGKT01kLOQNRqx9I@corigine.com \
--to=simon.horman@corigine.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=dchickles@marvell.com \
--cc=edumazet@google.com \
--cc=fmanlunas@marvell.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sburla@marvell.com \
--cc=yunchuan@nfschina.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.