From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: David Miller <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
netdev <netdev@vger.kernel.org>,
Russell King <rmk+kernel@arm.linux.org.uk>
Subject: Re: [PATCH net-next 2/5] net: dsa: mv88e6xxx: Hold mutex while doing stats operations
Date: Wed, 3 Jan 2018 16:02:07 +0100 [thread overview]
Message-ID: <20180103150207.GA3401@lunn.ch> (raw)
In-Reply-To: <878tdfdncl.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
On Wed, Jan 03, 2018 at 09:32:42AM -0500, Vivien Didelot wrote:
> Hi Andrew,
>
> Andrew Lunn <andrew@lunn.ch> writes:
>
> > -static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port)
> > +static int _mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port)
> > {
> > struct mv88e6xxx_chip *chip = ds->priv;
> >
> > @@ -702,6 +706,19 @@ static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port)
> > return 0;
> > }
>
> We worked to remove the old underscore prefix convention. Please don't
> add it back... Simply rework the return statements of
> mv88e6xxx_get_sset_count to lock/unlock there.
Hi Vivien
That makes mv88e6xxx_get_sset_count quite complex, making it error
prone. Doing the locking in a separate function makes is very clear
the lock is held and then correctly released. So i will just rename
_mv88e6xxx_get_sset_count() to mv88e6xxx_get_sset_count_locked()
Andrew
next prev parent reply other threads:[~2018-01-03 15:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 14:09 [PATCH net-next 0/5] Export SERDES stats via ethtool -S Andrew Lunn
2018-01-03 14:09 ` [PATCH net-next 1/5] dsa: Pass the port to get_sset_count() Andrew Lunn
2018-01-03 14:41 ` Vivien Didelot
2018-01-03 14:09 ` [PATCH net-next 2/5] net: dsa: mv88e6xxx: Hold mutex while doing stats operations Andrew Lunn
2018-01-03 14:32 ` Vivien Didelot
2018-01-03 15:02 ` Andrew Lunn [this message]
2018-01-03 15:43 ` Vivien Didelot
2018-01-03 14:09 ` [PATCH net-next 3/5] net: dsa: mv88e6xxx: Allow the SERDES interfaces to have statistics Andrew Lunn
2018-01-03 14:54 ` Vivien Didelot
2018-01-03 14:09 ` [PATCH net-next 4/5] net: dsa: mv88e6xxx: Add helper to determining if port has SERDES Andrew Lunn
2018-01-03 15:00 ` Vivien Didelot
2018-01-03 14:09 ` [PATCH net-next 5/5] net: dsa: mv88e6xxx: Get mv88e6352 SERDES statistics Andrew Lunn
2018-01-03 15:31 ` Vivien Didelot
2018-01-03 17:58 ` [PATCH net-next 0/5] Export SERDES stats via ethtool -S Russell King - ARM Linux
2018-01-04 21:07 ` Andrew Lunn
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=20180103150207.GA3401@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
--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).