From: Ding Tianhong <dthxman@gmail.com>
To: "Joe Perches" <joe@perches.com>,
"Ding Tianhong" <dingtianhong@huawei.com>,
"Sjur Brændeland" <sjur.brandeland@stericsson.com>
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>,
"David S. Miller" <davem@davemloft.net>,
Netdev <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare
Date: Sat, 28 Dec 2013 23:02:08 +0800 [thread overview]
Message-ID: <52BEE7F0.1070506@gmail.com> (raw)
In-Reply-To: <1388213953.24123.2.camel@joe-AO722>
于 2013/12/28 14:59, Joe Perches 写道:
> On Sat, 2013-12-28 at 14:18 +0800, Ding Tianhong wrote:
>> Use possibly more efficient ether_addr_equal
>> to instead of memcmp.
>
> This may be a distinction without difference, but
> is a CAIF seghead also an ethernet address?
>
NO,this is a coincidence, the CAIF seghead is 6 bytes too,
So from a logical point of view, maybe a new function with
suitable name will be more reasonable here, but the name of
ether_addr_equal is not correctly here.:)
thanks
Regards
Ding
>> diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c
> []
>> @@ -79,7 +79,7 @@ static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead,
> []
>> /* Verify correct header */
>> - if (memcmp(seghead, rfml->seghead, 6) != 0)
>> + if (!ether_addr_equal(seghead, rfml->seghead))
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2013-12-28 15:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-28 6:18 [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare Ding Tianhong
2013-12-28 6:59 ` Joe Perches
2013-12-28 15:02 ` Ding Tianhong [this message]
2013-12-28 17:04 ` Joe Perches
2013-12-30 2:14 ` Ding Tianhong
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=52BEE7F0.1070506@gmail.com \
--to=dthxman@gmail.com \
--cc=davem@davemloft.net \
--cc=dingtianhong@huawei.com \
--cc=dmitry.tarnyagin@lockless.no \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sjur.brandeland@stericsson.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