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

nfc: constify nfc_digital_ops

Neither the core nor the drivers modify the passed pointer to struct
nfc_digital_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
7186aac9 49545357

+7 -7
+1 -1
drivers/nfc/nfcsim.c
··· 320 320 return nfcsim_send(ddev, NULL, timeout, cb, arg); 321 321 } 322 322 323 - static struct nfc_digital_ops nfcsim_digital_ops = { 323 + static const struct nfc_digital_ops nfcsim_digital_ops = { 324 324 .in_configure_hw = nfcsim_in_configure_hw, 325 325 .in_send_cmd = nfcsim_in_send_cmd, 326 326
+1 -1
drivers/nfc/port100.c
··· 1463 1463 return port100_tg_send_cmd(ddev, skb, timeout, cb, arg); 1464 1464 } 1465 1465 1466 - static struct nfc_digital_ops port100_digital_ops = { 1466 + static const struct nfc_digital_ops port100_digital_ops = { 1467 1467 .in_configure_hw = port100_in_configure_hw, 1468 1468 .in_send_cmd = port100_in_send_cmd, 1469 1469
+1 -1
drivers/nfc/st95hf/core.c
··· 1037 1037 { 1038 1038 } 1039 1039 1040 - static struct nfc_digital_ops st95hf_nfc_digital_ops = { 1040 + static const struct nfc_digital_ops st95hf_nfc_digital_ops = { 1041 1041 .in_configure_hw = st95hf_in_configure_hw, 1042 1042 .in_send_cmd = st95hf_in_send_cmd, 1043 1043
+1 -1
drivers/nfc/trf7970a.c
··· 1861 1861 mutex_unlock(&trf->lock); 1862 1862 } 1863 1863 1864 - static struct nfc_digital_ops trf7970a_nfc_ops = { 1864 + static const struct nfc_digital_ops trf7970a_nfc_ops = { 1865 1865 .in_configure_hw = trf7970a_in_configure_hw, 1866 1866 .in_send_cmd = trf7970a_send_cmd, 1867 1867 .tg_configure_hw = trf7970a_tg_configure_hw,
+2 -2
include/net/nfc/digital.h
··· 191 191 192 192 struct nfc_digital_dev { 193 193 struct nfc_dev *nfc_dev; 194 - struct nfc_digital_ops *ops; 194 + const struct nfc_digital_ops *ops; 195 195 196 196 u32 protocols; 197 197 ··· 236 236 void (*skb_add_crc)(struct sk_buff *skb); 237 237 }; 238 238 239 - struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops, 239 + struct nfc_digital_dev *nfc_digital_allocate_device(const struct nfc_digital_ops *ops, 240 240 __u32 supported_protocols, 241 241 __u32 driver_capabilities, 242 242 int tx_headroom,
+1 -1
net/nfc/digital_core.c
··· 745 745 .im_transceive = digital_in_send, 746 746 }; 747 747 748 - struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops, 748 + struct nfc_digital_dev *nfc_digital_allocate_device(const struct nfc_digital_ops *ops, 749 749 __u32 supported_protocols, 750 750 __u32 driver_capabilities, 751 751 int tx_headroom, int tx_tailroom)