Skip to contentSkip to conversation

staging: rtl8712: Use ether_addr_copy() instead of memcpy()

PATCH In review Jagan Teki 3 participants 6 messages May 18, 2015 – May 20, 2015 Staging

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH v3 1/1 staging: rtl8712: Use ether_addr_copy() instead of memcpy()

Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

pahole output for respective structures:
- addr->sa_data

struct sockaddr {
	sa_family_t                sa_family;            /*     0     2 */
	char                       sa_data[14];          /*     2    14 */

	/* size: 16, cachelines: 1, members: 2 */
	/* last cacheline: 16 bytes */
};

- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure which is properly aligned and have some patches with this change as well. "staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()" (sha1: 36e4d8826b317080e283e4edd08bf8d5ac706f38)

Cc Greg Kroah-Hartman <[email protected]>
Cc Larry Finger <[email protected]>
Cc Florian Schilhabel <[email protected]>

---
Changes for v3:
- Removed unaligned conversions
Changes for v2:
- Describe a changelog, to prove address are aligned

 drivers/staging/rtl8712/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/os_intfs.c +1 -1
index 6e776e5..d5f4c4d 100644
@@ -181,7 +181,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
 	struct sockaddr *addr = p;
 
 	if (padapter->bup == false)
-		memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN);
+		ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
 	return 0;
 }
 
Signature · 1 line
1.9.1
author
#1 lore raw
Quoted 38 lines · Jagan Teki

Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

pahole output for respective structures:
- addr->sa_data
struct sockaddr {

        sa_family_t                sa_family;            /*     0     2 */
        char                       sa_data[14];          /*     2    14 */
        /* size: 16, cachelines: 1, members: 2 */
        /* last cacheline: 16 bytes */
};

- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure which is properly aligned and have some patches with this change as well. "staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()" (sha1: 36e4d8826b317080e283e4edd08bf8d5ac706f38)

Cc Greg Kroah-Hartman <[email protected]>
Cc Larry Finger <[email protected]>
Cc Florian Schilhabel <[email protected]>

---
Changes for v3:
- Removed unaligned conversions
Changes for v2:
- Describe a changelog, to prove address are aligned

 drivers/staging/rtl8712/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/os_intfs.c +0 -0
index 6e776e5..d5f4c4d 100644

drivers/staging/rtl8712/os_intfs.c static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)

Quoted 9 lines
drivers/staging/rtl8712/os_intfs.c +1 -2
@@ -181,7 +181,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
        struct sockaddr *addr = p;
 
        if (padapter->bup == false)
-               memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN);
+               ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
        return 0;
 }
 
--

Ping!

#2 lore raw
Quoted 1 line · Jagan Teki

Ping!

No answer means that Greg hasn't gotten to it yet and no one else has an issue with it. Wait for 2 weeks before asking or 4 weeks if a merge window is open.

regards,
dan carpenter

#3 lore raw
In reply to Jagan Teki
Quoted 47 lines · Jagan Teki
Quoted 46 lines · Jagan Teki

Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

pahole output for respective structures:
- addr->sa_data
struct sockaddr {

         sa_family_t                sa_family;            /*     0     2 */
         char                       sa_data[14];          /*     2    14 */
         /* size: 16, cachelines: 1, members: 2 */
         /* last cacheline: 16 bytes */
};

- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure which is properly aligned and have some patches with this change as well. "staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()" (sha1: 36e4d8826b317080e283e4edd08bf8d5ac706f38)

Cc Greg Kroah-Hartman <[email protected]>
Cc Larry Finger <[email protected]>
Cc Florian Schilhabel <[email protected]>

---
Changes for v3:
- Removed unaligned conversions
Changes for v2:
- Describe a changelog, to prove address are aligned

  drivers/staging/rtl8712/os_intfs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/os_intfs.c +1 -1
index 6e776e5..d5f4c4d 100644
@@ -181,7 +181,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
         struct sockaddr *addr = p;
 
         if (padapter->bup == false)
-               memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN);
+               ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
         return 0;
  }
 
Quoted 3 lines
Quoted 1 line

--

Ping!

Ah. Not only are you ignorant, but you are also rude! The patch was not NACKed, thus it will be picked up in good time.

Larry

author
#4 lore raw
Quoted 54 lines · Larry Finger
Quoted 53 lines · Jagan Teki
Quoted 51 lines · Jagan Teki

Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

pahole output for respective structures:
- addr->sa_data
struct sockaddr {
sa_family_t sa_family; /* 0 2
*/
char sa_data[14]; /* 2 14
*/

         /* size: 16, cachelines: 1, members: 2 */
         /* last cacheline: 16 bytes */
};

- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure which is properly aligned and have some patches with this change as well. "staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()" (sha1: 36e4d8826b317080e283e4edd08bf8d5ac706f38)

Cc Greg Kroah-Hartman <[email protected]>
Cc Larry Finger <[email protected]>
Cc Florian Schilhabel <[email protected]>

---
Changes for v3:
- Removed unaligned conversions
Changes for v2:
- Describe a changelog, to prove address are aligned

  drivers/staging/rtl8712/os_intfs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/os_intfs.c +1 -1
index 6e776e5..d5f4c4d 100644
@@ -181,7 +181,7 @@ static int r871x_net_set_mac_address(struct
 net_device *pnetdev, void *p)
         struct sockaddr *addr = p;
 
         if (padapter->bup == false)
-               memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN);
+               ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
         return 0;
  }
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

--

Ping!

Ah. Not only are you ignorant, but you are also rude! The patch was not NACKed, thus it will be picked up in good time.

What are these statements, sending a patch with valid proofs implies rudeness? Does this patch still have changes..?

Signature · 1 line
Jagan
#5 lore raw
Quoted 61 lines · Jagan Teki
Quoted 60 lines · Larry Finger
Quoted 57 lines · Jagan Teki
Quoted 42 lines · Jagan Teki

Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

pahole output for respective structures:
- addr->sa_data
struct sockaddr {
sa_family_t sa_family; /* 0 2
*/
char sa_data[14]; /* 2 14
*/

          /* size: 16, cachelines: 1, members: 2 */
          /* last cacheline: 16 bytes */
};

- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure which is properly aligned and have some patches with this change as well. "staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()" (sha1: 36e4d8826b317080e283e4edd08bf8d5ac706f38)

Cc Greg Kroah-Hartman <[email protected]>
Cc Larry Finger <[email protected]>
Cc Florian Schilhabel <[email protected]>

---
Changes for v3:
- Removed unaligned conversions
Changes for v2:
- Describe a changelog, to prove address are aligned

   drivers/staging/rtl8712/os_intfs.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/os_intfs.c +0 -0
index 6e776e5..d5f4c4d 100644

drivers/staging/rtl8712/os_intfs.c static int r871x_net_set_mac_address(struct

Quoted 10 lines
drivers/staging/rtl8712/os_intfs.c +1 -2
@@ -181,7 +181,7 @@ static int r871x_net_set_mac_address(struct
 net_device *pnetdev, void *p)
          struct sockaddr *addr = p;
 
          if (padapter->bup == false)
-               memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN);
+               ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
          return 0;
   }
 
--

Ping!

Quoted 5 lines
Quoted 2 lines

Ah. Not only are you ignorant, but you are also rude! The patch was not NACKed, thus it will be picked up in good time.

What are these statements, sending a patch with valid proofs implies rudeness? Does this patch still have changes..?

No, that patch (V3) is OK. Sending a ping after 2 days is most certainly rude. That implies that no one has anything better to do than cater to your submissions. As Greg told you, wait for a while.

Larry