net: caif: slight optimization of addr compare
Subsystems (2)
PATCH v2 20/20 net: caif: slight optimization of addr compare
Use possibly more efficient ether_addr_equal to instead of memcmp.
--- net/caif/cfrfml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/caif/cfrfml.c +1 -1
@@ -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,
Signature · 1 line
1.8.0
Quoted 2 lines · Ding Tianhong
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?
net/caif/cfrfml.c
Quoted 1 line
net/caif/cfrfml.c +0
-0
[]
net/caif/cfrfml.c static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead,
Quoted 1 line
net/caif/cfrfml.c +0
-0@@ -79,7 +79,7 @@ static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead,
[]
Quoted 3 lines
net/caif/cfrfml.c +1
-1/* Verify correct header */ -if (memcmp (seghead, rfml->seghead,6 ) !=0 ) +if (!ether_addr_equal (seghead, rfml->seghead))
Quoted 7 lines · Joe Perches
Quoted 2 lines · Ding Tianhong
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
Quoted 14 lines
net/caif/cfrfml.c
Quoted 1 line
net/caif/cfrfml.c +0
-0[]
net/caif/cfrfml.c static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead,
Quoted 1 line
net/caif/cfrfml.c +0
-0@@ -79,7 +79,7 @@ static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead,[]
net/caif/cfrfml.c static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead, · line 82
Quoted 3 lines
net/caif/cfrfml.c +1
-1/* 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Ding Tianhong
Quoted 4 lines · Joe Perches
Quoted 2 lines · Ding Tianhong
Use possibly more efficient
ether_addr_equal
to instead of memcmp.
Quoted 7 lines
Quoted 3 lines
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_equalis not correctly here.:)
So please remove this one from the series.
Quoted 9 lines · Joe Perches
Quoted 8 lines · Ding Tianhong
Quoted 7 lines · Joe Perches
Quoted 2 lines · Ding Tianhong
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?
Quoted 8 lines
Quoted 4 lines
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_equalis not correctly here.:)So please remove this one from the series.
Yes, Ok!
Regards
Ding