From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Egil Hjelmeland <privat@egil-hjelmeland.no>,
f.fainelli@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next 1/2] net: dsa: lan9303: Add port_fast_age and port_fdb_dump methods
Date: Thu, 19 Oct 2017 16:15:05 +0200 [thread overview]
Message-ID: <20171019141505.GA14840@lunn.ch> (raw)
In-Reply-To: <87mv4nw869.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
> > +/* Clear learned (non-static) entry on given port */
> > +static void alr_loop_cb_del_port_learned(struct lan9303 *chip, u32 dat0,
> > + u32 dat1, int portmap, void *ctx)
> > +{
> > + int *port = ctx;
>
> You can get the value directly to make the line below more readable:
>
> int port = *(int *)ctx;
You have to be a bit careful with this. You often see people
submitting patches taking away casts for void * pointers.
If they do that here, it should at least not compile...
So maybe do it in two steps?
int * pport = ctx;
int port = *pport;
???
Andrew
next prev parent reply other threads:[~2017-10-19 14:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 12:10 [PATCH v2 net-next 0/2] net: dsa: lan9303: Add fdb/mdb methods Egil Hjelmeland
2017-10-19 12:10 ` [PATCH v2 net-next 1/2] net: dsa: lan9303: Add port_fast_age and port_fdb_dump methods Egil Hjelmeland
2017-10-19 13:58 ` Vivien Didelot
2017-10-19 14:15 ` Andrew Lunn [this message]
2017-10-19 14:51 ` Egil Hjelmeland
2017-10-19 15:15 ` David Laight
2017-10-19 15:42 ` Egil Hjelmeland
2017-10-19 16:52 ` Egil Hjelmeland
2017-10-20 8:59 ` David Laight
2017-10-19 14:46 ` Egil Hjelmeland
2017-10-19 15:12 ` Vivien Didelot
2017-10-19 15:19 ` Egil Hjelmeland
2017-10-19 12:10 ` [PATCH v2 net-next 2/2] net: dsa: lan9303: Add fdb/mdb manipulation Egil Hjelmeland
2017-10-19 14:53 ` Vivien Didelot
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=20171019141505.GA14840@lunn.ch \
--to=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=privat@egil-hjelmeland.no \
--cc=vivien.didelot@savoirfairelinux.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 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).