diff mbox series

[net-next,1/2] bluetooth: use eth_hw_addr_set()

Message ID 20211022174232.2510917-2-kuba@kernel.org (mailing list archive)
State Superseded
Headers show
Series bluetooth: don't write directly to netdev->dev_addr | expand

Checks

Context Check Description
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/buildkernel fail Build Kernel make FAIL: net/bluetooth/6lowpan.c: In function ‘setup_netdev’: net/bluetooth/6lowpan.c:677:25: error: passing argument 2 of ‘__dev_addr_set’ from incompatible pointer type [-Werror=incompatible-pointer-types] 677 | __dev_addr_set(netdev, &addr, sizeof(addr)); | ^~~~~ | | | bdaddr_t * {aka struct <anonymous> *} In file included from ./include/uapi/linux/if_arp.h:27, from ./include/linux/if_arp.h:23, from net/bluetooth/6lowpan.c:7: ./include/linux/netdevice.h:4645:50: note: expected ‘const u8 *’ {aka ‘const unsigned char *’} but argument is of type ‘bdaddr_t *’ {aka ‘struct <anonymous> *’} 4645 | __dev_addr_set(struct net_device *dev, const u8 *addr, size_t len) | ~~~~~~~~~~^~~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:277: net/bluetooth/6lowpan.o] Error 1 make[1]: *** [scripts/Makefile.build:540: net/bluetooth] Error 2 make: *** [Makefile:1868: net] Error 2
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 468, Passed: 0 (0.0%), Failed: 0, Not Run: 468
tedd_an/testrunnerrfcomm-tester success Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Jakub Kicinski Oct. 22, 2021, 5:42 p.m. UTC
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Convert bluetooth from memcpy(... ETH_ADDR) to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - memcpy(dev->dev_addr, np, ETH_ALEN)
  + eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
---
 net/bluetooth/bnep/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Oct. 22, 2021, 6:11 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=568737

---Test result---

Test Summary:
CheckPatch                    PASS      1.38 seconds
GitLint                       PASS      0.72 seconds
BuildKernel                   FAIL      533.55 seconds
TestRunner: Setup             PASS      424.84 seconds
TestRunner: l2cap-tester      PASS      8.46 seconds
TestRunner: bnep-tester       PASS      4.73 seconds
TestRunner: mgmt-tester       PASS      43.03 seconds
TestRunner: rfcomm-tester     PASS      5.60 seconds
TestRunner: sco-tester        PASS      6.05 seconds
TestRunner: smp-tester        PASS      5.72 seconds
TestRunner: userchan-tester   PASS      4.91 seconds

Details
##############################
Test: BuildKernel - FAIL - 533.55 seconds
Build Kernel with minimal configuration supports Bluetooth
net/bluetooth/6lowpan.c: In function ‘setup_netdev’:
net/bluetooth/6lowpan.c:677:25: error: passing argument 2 of ‘__dev_addr_set’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  677 |  __dev_addr_set(netdev, &addr, sizeof(addr));
      |                         ^~~~~
      |                         |
      |                         bdaddr_t * {aka struct <anonymous> *}
In file included from ./include/uapi/linux/if_arp.h:27,
                 from ./include/linux/if_arp.h:23,
                 from net/bluetooth/6lowpan.c:7:
./include/linux/netdevice.h:4645:50: note: expected ‘const u8 *’ {aka ‘const unsigned char *’} but argument is of type ‘bdaddr_t *’ {aka ‘struct <anonymous> *’}
 4645 | __dev_addr_set(struct net_device *dev, const u8 *addr, size_t len)
      |                                        ~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:277: net/bluetooth/6lowpan.o] Error 1
make[1]: *** [scripts/Makefile.build:540: net/bluetooth] Error 2
make: *** [Makefile:1868: net] Error 2




---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 72f47b372705..c9add7753b9f 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -594,7 +594,7 @@  int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
 	 * ie. eh.h_dest is our local address. */
 	memcpy(s->eh.h_dest,   &src, ETH_ALEN);
 	memcpy(s->eh.h_source, &dst, ETH_ALEN);
-	memcpy(dev->dev_addr, s->eh.h_dest, ETH_ALEN);
+	eth_hw_addr_set(dev, s->eh.h_dest);
 
 	s->dev   = dev;
 	s->sock  = sock;