Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-29 Thread Ding Tianhong
On 2013/12/29 1:04, Joe Perches wrote:
> On Sat, 2013-12-28 at 23:02 +0800, Ding Tianhong wrote:
>> 于 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.:)
> 
> So please remove this one from the series.
> 
> 

Yes, Ok!

Regards
Ding
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-29 Thread Ding Tianhong
On 2013/12/29 1:04, Joe Perches wrote:
 On Sat, 2013-12-28 at 23:02 +0800, Ding Tianhong wrote:
 于 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.:)
 
 So please remove this one from the series.
 
 

Yes, Ok!

Regards
Ding
 
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-28 Thread Joe Perches
On Sat, 2013-12-28 at 23:02 +0800, Ding Tianhong wrote:
> 于 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.:)

So please remove this one from the series.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-28 Thread Ding Tianhong
于 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 majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-28 Thread Ding Tianhong
于 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 majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-28 Thread Joe Perches
On Sat, 2013-12-28 at 23:02 +0800, Ding Tianhong wrote:
 于 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.:)

So please remove this one from the series.


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-27 Thread 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?

> 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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-27 Thread Ding Tianhong
Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Dmitry Tarnyagin 
Cc: "David S. Miller" 
Signed-off-by: Ding Tianhong 
---
 net/caif/cfrfml.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c
index 61d7617..c680414 100644
--- a/net/caif/cfrfml.c
+++ b/net/caif/cfrfml.c
@@ -79,7 +79,7 @@ static struct cfpkt *rfm_append(struct cfrfml *rfml, char 
*seghead,
return NULL;
 
/* Verify correct header */
-   if (memcmp(seghead, rfml->seghead, 6) != 0)
+   if (!ether_addr_equal(seghead, rfml->seghead))
return NULL;
 
tmppkt = cfpkt_append(rfml->incomplete_frm, pkt,
-- 
1.8.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-27 Thread Ding Tianhong
Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Dmitry Tarnyagin dmitry.tarnya...@lockless.no
Cc: David S. Miller da...@davemloft.net
Signed-off-by: Ding Tianhong dingtianh...@huawei.com
---
 net/caif/cfrfml.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c
index 61d7617..c680414 100644
--- a/net/caif/cfrfml.c
+++ b/net/caif/cfrfml.c
@@ -79,7 +79,7 @@ static struct cfpkt *rfm_append(struct cfrfml *rfml, char 
*seghead,
return NULL;
 
/* Verify correct header */
-   if (memcmp(seghead, rfml-seghead, 6) != 0)
+   if (!ether_addr_equal(seghead, rfml-seghead))
return NULL;
 
tmppkt = cfpkt_append(rfml-incomplete_frm, pkt,
-- 
1.8.0


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare

2013-12-27 Thread 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?

 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 linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/