]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
nfc: constify nfc_hci_gate
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Sat, 24 Jul 2021 21:49:24 +0000 (23:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 25 Jul 2021 08:21:21 +0000 (09:21 +0100)
Neither the core nor the drivers modify the passed pointer to struct
nfc_hci_gate, so make it a pointer to const for correctness and safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/nfc/microread/microread.c
drivers/nfc/pn544/pn544.c
drivers/nfc/st21nfca/core.c
net/nfc/hci/core.c

index a5d5c3ec65f9d796499ac94b0a040167d0e03fd6..151a0631ec72e26ce221d5968e6c9cbaea83ae9e 100644 (file)
 #define MICROREAD_ELT_ID_SE2 0x04
 #define MICROREAD_ELT_ID_SE3 0x05
 
-static struct nfc_hci_gate microread_gates[] = {
+static const struct nfc_hci_gate microread_gates[] = {
        {MICROREAD_GATE_ID_ADM, MICROREAD_PIPE_ID_ADMIN},
        {MICROREAD_GATE_ID_LOOPBACK, MICROREAD_PIPE_ID_HDS_LOOPBACK},
        {MICROREAD_GATE_ID_IDT, MICROREAD_PIPE_ID_HDS_IDT},
index 23faa46bb48636c86a9570845f45dfccdda6f9af..f4d09ebba5c861434e418c1eedfb86165ad25a56 100644 (file)
@@ -86,7 +86,7 @@ enum pn544_state {
 #define PN544_HCI_CMD_ATTREQUEST               0x12
 #define PN544_HCI_CMD_CONTINUE_ACTIVATION      0x13
 
-static struct nfc_hci_gate pn544_gates[] = {
+static const struct nfc_hci_gate pn544_gates[] = {
        {NFC_HCI_ADMIN_GATE, NFC_HCI_INVALID_PIPE},
        {NFC_HCI_LOOPBACK_GATE, NFC_HCI_INVALID_PIPE},
        {NFC_HCI_ID_MGMT_GATE, NFC_HCI_INVALID_PIPE},
index 583c36d4ff672cd862648f81b09b57d4999d77a2..675f8a3428699b665aed419619ae1819a1a109b7 100644 (file)
@@ -72,7 +72,7 @@
 
 static DECLARE_BITMAP(dev_mask, ST21NFCA_NUM_DEVICES);
 
-static struct nfc_hci_gate st21nfca_gates[] = {
+static const struct nfc_hci_gate st21nfca_gates[] = {
        {NFC_HCI_ADMIN_GATE, NFC_HCI_ADMIN_PIPE},
        {NFC_HCI_LINK_MGMT_GATE, NFC_HCI_LINK_MGMT_PIPE},
        {ST21NFCA_DEVICE_MGNT_GATE, ST21NFCA_DEVICE_MGNT_PIPE},
index 3481941be70ba798a908706236cb8f2a38729a92..e37d30302b060d0ea827c12a7565dd6338bb2149 100644 (file)
@@ -447,7 +447,7 @@ static void nfc_hci_cmd_timeout(struct timer_list *t)
 }
 
 static int hci_dev_connect_gates(struct nfc_hci_dev *hdev, u8 gate_count,
-                                struct nfc_hci_gate *gates)
+                                const struct nfc_hci_gate *gates)
 {
        int r;
        while (gate_count--) {