diff mbox series

[v3,1/3] Bluetooth: use inclusive language in HCI role comments

Message ID 20210604162616.v3.1.I444f42473f263fed77f2586eb4b01d6752df0de4@changeid (mailing list archive)
State New, archived
Headers show
Series [v3,1/3] Bluetooth: use inclusive language in HCI role comments | expand

Commit Message

Archie Pusaka June 4, 2021, 8:26 a.m. UTC
From: Archie Pusaka <apusaka@chromium.org>

This patch replaces some non-inclusive terms based on the appropriate
language mapping table compiled by the Bluetooth SIG:
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf

Specifically, these terms are replaced:
master -> initiator (for smp) or central (everything else)
slave  -> responder (for smp) or peripheral (everything else)

The #define preprocessor terms are unchanged for now to not disturb
dependent APIs.

Signed-off-by: Archie Pusaka <apusaka@chromium.org>

---

Changes in v3:
* Remove the #define terms from change

 net/bluetooth/hci_conn.c   | 8 ++++----
 net/bluetooth/hci_event.c  | 6 +++---
 net/bluetooth/l2cap_core.c | 2 +-
 net/bluetooth/smp.c        | 6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

Comments

Bastien Nocera June 4, 2021, 8:38 a.m. UTC | #1
On Fri, 2021-06-04 at 16:26 +0800, Archie Pusaka wrote:
> 
> The #define preprocessor terms are unchanged for now to not disturb
> dependent APIs.

Could we add new defines, and deprecate the old ones? Something akin
to that would help migrate the constants, over time:
https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gmacros.h#L686-716
Archie Pusaka June 4, 2021, 8:56 a.m. UTC | #2
Hi Bastien,

Thanks! That was a great input.
I'm not sure though, do we have a standard, proper way to deprecate macros?
Or does a simple /* deprecated */ comment works for now?

Cheers,
Archie


On Fri, 4 Jun 2021 at 16:39, Bastien Nocera <hadess@hadess.net> wrote:
>
> On Fri, 2021-06-04 at 16:26 +0800, Archie Pusaka wrote:
> >
> > The #define preprocessor terms are unchanged for now to not disturb
> > dependent APIs.
>
> Could we add new defines, and deprecate the old ones? Something akin
> to that would help migrate the constants, over time:
> https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gmacros.h#L686-716
>
Bastien Nocera June 4, 2021, 9:09 a.m. UTC | #3
On Fri, 2021-06-04 at 16:56 +0800, Archie Pusaka wrote:
> Hi Bastien,
> 
> Thanks! That was a great input.
> I'm not sure though, do we have a standard, proper way to deprecate
> macros?
> Or does a simple /* deprecated */ comment works for now?

I think we might need to add #ifdef around those instead unfortunately,
something like "#ifndef BLUETOOTH_NO_DEPRECATED_CONSTANTS" around the
old names.

> 
> Cheers,
> Archie
> 
> 
> On Fri, 4 Jun 2021 at 16:39, Bastien Nocera <hadess@hadess.net>
> wrote:
> > 
> > On Fri, 2021-06-04 at 16:26 +0800, Archie Pusaka wrote:
> > > 
> > > The #define preprocessor terms are unchanged for now to not
> > > disturb
> > > dependent APIs.
> > 
> > Could we add new defines, and deprecate the old ones? Something
> > akin
> > to that would help migrate the constants, over time:
> > https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gmacros.h#L686-716
> >
bluez.test.bot@gmail.com June 4, 2021, 10:26 a.m. UTC | #4
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=494003

---Test result---

Test Summary:
CheckPatch                    FAIL      3.54 seconds
GitLint                       FAIL      0.32 seconds
BuildKernel                   PASS      515.15 seconds
TestRunner: Setup             PASS      335.38 seconds
TestRunner: l2cap-tester      PASS      2.57 seconds
TestRunner: bnep-tester       PASS      1.86 seconds
TestRunner: mgmt-tester       PASS      28.48 seconds
TestRunner: rfcomm-tester     PASS      2.08 seconds
TestRunner: sco-tester        PASS      1.97 seconds
TestRunner: smp-tester        PASS      2.09 seconds
TestRunner: userchan-tester   PASS      1.88 seconds

Details
##############################
Test: CheckPatch - FAIL - 3.54 seconds
Run checkpatch.pl script with rule in .checkpatch.conf
Bluetooth: use inclusive language in HCI role comments
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#8: 
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf

total: 0 errors, 1 warnings, 0 checks, 72 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] Bluetooth: use inclusive language in HCI role comments" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Bluetooth: use inclusive language when tracking connections
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#8: 
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf

total: 0 errors, 1 warnings, 0 checks, 70 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] Bluetooth: use inclusive language when tracking connections" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Bluetooth: use inclusive language when filtering devices
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#8: 
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf

total: 0 errors, 1 warnings, 0 checks, 696 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] Bluetooth: use inclusive language when filtering devices" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL - 0.32 seconds
Run gitlint with rule in .gitlint
Bluetooth: use inclusive language in HCI role comments
5: B1 Line exceeds max length (95>80): "https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf"

Bluetooth: use inclusive language when tracking connections
5: B1 Line exceeds max length (95>80): "https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf"

Bluetooth: use inclusive language when filtering devices
5: B1 Line exceeds max length (95>80): "https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf"


##############################
Test: BuildKernel - PASS - 515.15 seconds
Build Kernel with minimal configuration supports Bluetooth


##############################
Test: TestRunner: Setup - PASS - 335.38 seconds
Setup environment for running Test Runner


##############################
Test: TestRunner: l2cap-tester - PASS - 2.57 seconds
Run test-runner with l2cap-tester
Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: bnep-tester - PASS - 1.86 seconds
Run test-runner with bnep-tester
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: mgmt-tester - PASS - 28.48 seconds
Run test-runner with mgmt-tester
Total: 446, Passed: 433 (97.1%), Failed: 0, Not Run: 13

##############################
Test: TestRunner: rfcomm-tester - PASS - 2.08 seconds
Run test-runner with rfcomm-tester
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: sco-tester - PASS - 1.97 seconds
Run test-runner with sco-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: smp-tester - PASS - 2.09 seconds
Run test-runner with smp-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: userchan-tester - PASS - 1.88 seconds
Run test-runner with userchan-tester
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth
Marcel Holtmann June 4, 2021, 3:27 p.m. UTC | #5
Hi Archie,

> This patch replaces some non-inclusive terms based on the appropriate
> language mapping table compiled by the Bluetooth SIG:
> https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf
> 
> Specifically, these terms are replaced:
> master -> initiator (for smp) or central (everything else)
> slave  -> responder (for smp) or peripheral (everything else)
> 
> The #define preprocessor terms are unchanged for now to not disturb
> dependent APIs.
> 
> Signed-off-by: Archie Pusaka <apusaka@chromium.org>
> 
> ---
> 
> Changes in v3:
> * Remove the #define terms from change
> 
> net/bluetooth/hci_conn.c   | 8 ++++----
> net/bluetooth/hci_event.c  | 6 +++---
> net/bluetooth/l2cap_core.c | 2 +-
> net/bluetooth/smp.c        | 6 +++---
> 4 files changed, 11 insertions(+), 11 deletions(-)

all 3 patches have been applied to bluetooth-next tree.

Regards

Marcel
diff mbox series

Patch

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index ea0f9cdaa6b1..2b5059a56cda 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -257,7 +257,7 @@  int hci_disconnect(struct hci_conn *conn, __u8 reason)
 {
 	BT_DBG("hcon %p", conn);
 
-	/* When we are master of an established connection and it enters
+	/* When we are central of an established connection and it enters
 	 * the disconnect timeout, then go ahead and try to read the
 	 * current clock offset.  Processing of the result is done
 	 * within the event handling and hci_clock_offset_evt function.
@@ -1109,9 +1109,9 @@  struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
 
 	hci_req_init(&req, hdev);
 
-	/* Disable advertising if we're active. For master role
+	/* Disable advertising if we're active. For central role
 	 * connections most controllers will refuse to connect if
-	 * advertising is enabled, and for slave role connections we
+	 * advertising is enabled, and for peripheral role connections we
 	 * anyway have to disable it in order to start directed
 	 * advertising. Any registered advertisements will be
 	 * re-enabled after the connection attempt is finished.
@@ -1119,7 +1119,7 @@  struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
 	if (hci_dev_test_flag(hdev, HCI_LE_ADV))
 		__hci_req_pause_adv_instances(&req);
 
-	/* If requested to connect as slave use directed advertising */
+	/* If requested to connect as peripheral use directed advertising */
 	if (conn->role == HCI_ROLE_SLAVE) {
 		/* If we're active scanning most controllers are unable
 		 * to initiate advertising. Simply reject the attempt.
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 43c324c46c0b..da013d485f14 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2795,9 +2795,9 @@  static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
 		bacpy(&cp.bdaddr, &ev->bdaddr);
 
 		if (lmp_rswitch_capable(hdev) && (mask & HCI_LM_MASTER))
-			cp.role = 0x00; /* Become master */
+			cp.role = 0x00; /* Become central */
 		else
-			cp.role = 0x01; /* Remain slave */
+			cp.role = 0x01; /* Remain peripheral */
 
 		hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp), &cp);
 	} else if (!(flags & HCI_PROTO_DEFER)) {
@@ -5131,7 +5131,7 @@  static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
 		conn->dst_type = bdaddr_type;
 
 		/* If we didn't have a hci_conn object previously
-		 * but we're in master role this must be something
+		 * but we're in central role this must be something
 		 * initiated using a white list. Since white list based
 		 * connections are not "first class citizens" we don't
 		 * have full tracking of them. Therefore, we go ahead
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 9ebb85df4db4..b76c5d00b082 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1691,7 +1691,7 @@  static void l2cap_le_conn_ready(struct l2cap_conn *conn)
 	if (hcon->out)
 		smp_conn_security(hcon, hcon->pending_sec_level);
 
-	/* For LE slave connections, make sure the connection interval
+	/* For LE peripheral connections, make sure the connection interval
 	 * is in the range of the minimum and maximum interval that has
 	 * been configured for this connection. If not, then trigger
 	 * the connection update procedure.
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 6777f5313838..53f984d11bc1 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -909,8 +909,8 @@  static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth,
 			hcon->pending_sec_level = BT_SECURITY_HIGH;
 	}
 
-	/* If both devices have Keyoard-Display I/O, the master
-	 * Confirms and the slave Enters the passkey.
+	/* If both devices have Keyboard-Display I/O, the initiator
+	 * Confirms and the responder Enters the passkey.
 	 */
 	if (smp->method == OVERLAP) {
 		if (hcon->role == HCI_ROLE_MASTER)
@@ -3083,7 +3083,7 @@  static void bredr_pairing(struct l2cap_chan *chan)
 	if (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
 		return;
 
-	/* Only master may initiate SMP over BR/EDR */
+	/* Only initiator may initiate SMP over BR/EDR */
 	if (hcon->role != HCI_ROLE_MASTER)
 		return;