diff mbox series

[1/2] bluetooth: use eth_hw_addr_set()

Message ID 20211019163346.1384785-1-kuba@kernel.org (mailing list archive)
State Accepted
Delegated to: Marcel Holtmann
Headers show
Series [1/2] bluetooth: use eth_hw_addr_set() | 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: 468 (100.0%), Failed: 0, Not Run: 0
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. 19, 2021, 4:33 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>
---
 net/bluetooth/bnep/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Oct. 19, 2021, 6:05 p.m. UTC | #1
On Tue, 19 Oct 2021 10:29:08 -0700 (PDT) bluez.test.bot@gmail.com wrote:
> 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=566505

Eish, sorry, you need 40af35fdf79c ("netdevice: demote the type of some
dev_addr_set() helpers") from net-next for this change to build cleanly.

What are your plans on sending a PR for net-next? Probably easiest if I
resend this after such PR? Or apply directly to net-next.
Marcel Holtmann Oct. 19, 2021, 6:26 p.m. UTC | #2
Hi Jakub,

>> 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=566505
> 
> Eish, sorry, you need 40af35fdf79c ("netdevice: demote the type of some
> dev_addr_set() helpers") from net-next for this change to build cleanly.
> 
> What are your plans on sending a PR for net-next? Probably easiest if I
> resend this after such PR? Or apply directly to net-next.

we have one more pull request for you in the works, but I was not planning
to rebase bluetooth-next if not needed. So just go ahead and take the patch
directly into net-next.

Reviewed-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel
Jakub Kicinski Oct. 19, 2021, 7:02 p.m. UTC | #3
On Tue, 19 Oct 2021 20:26:39 +0200 Marcel Holtmann wrote:
> >> 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=566505  
> > 
> > Eish, sorry, you need 40af35fdf79c ("netdevice: demote the type of some
> > dev_addr_set() helpers") from net-next for this change to build cleanly.
> > 
> > What are your plans on sending a PR for net-next? Probably easiest if I
> > resend this after such PR? Or apply directly to net-next.  
> 
> we have one more pull request for you in the works, but I was not planning
> to rebase bluetooth-next if not needed. So just go ahead and take the patch
> directly into net-next.
> 
> Reviewed-by: Marcel Holtmann <marcel@holtmann.org>
> Acked-by: Marcel Holtmann <marcel@holtmann.org>

Will do, thanks!
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;