lkml.org 
[lkml]   [2018]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 75/76] staging: ks7010: Replace memcmp() with ether_addr_equal().
    Date
    ether_addr_equal() is the function for comparing HW addresses,
    so remove the manual memcmp operation and replace it with
    ether_addr_equals().

    Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
    ---
    drivers/staging/ks7010/ks_hostif.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
    index b97080f8ebd2..fd1bf5d7ecd4 100644
    --- a/drivers/staging/ks7010/ks_hostif.c
    +++ b/drivers/staging/ks7010/ks_hostif.c
    @@ -411,7 +411,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
    eth_proto = ntohs(eth_hdr->h_proto);

    /* source address check */
    - if (memcmp(dev->dev_addr, eth_hdr->h_source, ETH_ALEN) == 0) {
    + if (ether_addr_equal(dev->dev_addr, eth_hdr->h_source)) {
    netdev_err(dev, "invalid : source is own mac address !!\n");
    netdev_err(dev,
    "eth_hdrernet->h_dest=%02X:%02X:%02X:%02X:%02X:%02X\n",
    @@ -1103,7 +1103,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)

    /* skb check */
    eth = (struct ethhdr *)skb->data;
    - if (memcmp(priv->net_dev->dev_addr, eth->h_source, ETH_ALEN) != 0) {
    + if (ether_addr_equal(priv->net_dev->dev_addr, eth->h_source)) {
    netdev_err(priv->net_dev, "invalid mac address !!\n");
    netdev_err(priv->net_dev, "ethernet->h_source=%pM\n", eth->h_source);
    ret = -ENXIO;
    --
    2.16.3
    \
     
     \ /
      Last update: 2018-03-30 09:10    [W:4.086 / U:0.168 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site