[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D4111F1E0@AcuExch.aculab.com>
Date: Mon, 14 Mar 2016 16:43:27 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Ben Hutchings' <ben@...adent.org.uk>,
David Decotigny <ddecotig@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Jeff Garzik <jgarzik@...ox.com>, David Miller <davem@...hat.com>,
"Vidya Sagar Ravipati" <vidya@...ulusnetworks.com>,
Joe Perches <joe@...ches.com>,
David Decotigny <decot@...glers.com>
Subject: RE: [ethtool PATCH v4 10/11] ethtool.c: add support for
ETHTOOL_xLINKSETTINGS ioctls
> > + /* ignore optional '0x' prefix */
> > + if ((slen > 2) && (
Unnecessary ().
> > + (0 == memcmp(s, "0x", 2)
> > + || (0 == memcmp(s, "0X", 2))))) {
A-about-F comparisons.
> memcmp() is a really poor tool for comparing strings. You should use
> strncasecmp() here.
Even that is overkill, why not just:
if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))
David
Powered by blists - more mailing lists