Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfc: constify nfc_hci_ops

Neither the core nor the drivers modify the passed pointer to struct
nfc_hci_ops, 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>

authored by

Krzysztof Kozlowski and committed by
David S. Miller
094c45c8 f6c802a7

+6 -6
+1 -1
drivers/nfc/microread/microread.c
··· 625 625 return r; 626 626 } 627 627 628 - static struct nfc_hci_ops microread_hci_ops = { 628 + static const struct nfc_hci_ops microread_hci_ops = { 629 629 .open = microread_open, 630 630 .close = microread_close, 631 631 .hci_ready = microread_hci_ready,
+1 -1
drivers/nfc/pn544/pn544.c
··· 881 881 } 882 882 } 883 883 884 - static struct nfc_hci_ops pn544_hci_ops = { 884 + static const struct nfc_hci_ops pn544_hci_ops = { 885 885 .open = pn544_hci_open, 886 886 .close = pn544_hci_close, 887 887 .hci_ready = pn544_hci_ready,
+1 -1
drivers/nfc/st21nfca/core.c
··· 912 912 } 913 913 } 914 914 915 - static struct nfc_hci_ops st21nfca_hci_ops = { 915 + static const struct nfc_hci_ops st21nfca_hci_ops = { 916 916 .open = st21nfca_hci_open, 917 917 .close = st21nfca_hci_close, 918 918 .load_session = st21nfca_hci_load_session,
+2 -2
include/net/nfc/hci.h
··· 118 118 119 119 struct sk_buff_head msg_rx_queue; 120 120 121 - struct nfc_hci_ops *ops; 121 + const struct nfc_hci_ops *ops; 122 122 123 123 struct nfc_llc *llc; 124 124 ··· 151 151 }; 152 152 153 153 /* hci device allocation */ 154 - struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, 154 + struct nfc_hci_dev *nfc_hci_allocate_device(const struct nfc_hci_ops *ops, 155 155 struct nfc_hci_init_data *init_data, 156 156 unsigned long quirks, 157 157 u32 protocols,
+1 -1
net/nfc/hci/core.c
··· 947 947 .se_io = hci_se_io, 948 948 }; 949 949 950 - struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, 950 + struct nfc_hci_dev *nfc_hci_allocate_device(const struct nfc_hci_ops *ops, 951 951 struct nfc_hci_init_data *init_data, 952 952 unsigned long quirks, 953 953 u32 protocols,