]> www.infradead.org Git - nvme.git/commitdiff
nfc: constify nfc_digital_ops
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Sat, 24 Jul 2021 21:49:28 +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_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>
drivers/nfc/nfcsim.c
drivers/nfc/port100.c
drivers/nfc/st95hf/core.c
drivers/nfc/trf7970a.c
include/net/nfc/digital.h
net/nfc/digital_core.c

index a9864fcdfba6b07ef67056c8475dba409c7c329b..143dc49b815bdac2a5ab595546631493bef0657a 100644 (file)
@@ -320,7 +320,7 @@ static int nfcsim_tg_listen(struct nfc_digital_dev *ddev, u16 timeout,
        return nfcsim_send(ddev, NULL, timeout, cb, arg);
 }
 
-static struct nfc_digital_ops nfcsim_digital_ops = {
+static const struct nfc_digital_ops nfcsim_digital_ops = {
        .in_configure_hw = nfcsim_in_configure_hw,
        .in_send_cmd = nfcsim_in_send_cmd,
 
index 1d614f9d864a480c3b847bf6b4d367ae64dcb9aa..ccb5c5fab905ddf16a07c1b9a98e5e24838407e6 100644 (file)
@@ -1463,7 +1463,7 @@ static int port100_listen(struct nfc_digital_dev *ddev, u16 timeout,
        return port100_tg_send_cmd(ddev, skb, timeout, cb, arg);
 }
 
-static struct nfc_digital_ops port100_digital_ops = {
+static const struct nfc_digital_ops port100_digital_ops = {
        .in_configure_hw = port100_in_configure_hw,
        .in_send_cmd = port100_in_send_cmd,
 
index 2dc788c363fdf0462862adaddaddd6d1196d1340..993818742570d160751b261a2e5fa509c09b286f 100644 (file)
@@ -1037,7 +1037,7 @@ static void st95hf_abort_cmd(struct nfc_digital_dev *ddev)
 {
 }
 
-static struct nfc_digital_ops st95hf_nfc_digital_ops = {
+static const struct nfc_digital_ops st95hf_nfc_digital_ops = {
        .in_configure_hw = st95hf_in_configure_hw,
        .in_send_cmd = st95hf_in_send_cmd,
 
index 33978022ae475e093e042da8cb439ef4cdb72c2f..1aed44629aaaadf69f48c4add8044c2db47ed06c 100644 (file)
@@ -1861,7 +1861,7 @@ static void trf7970a_abort_cmd(struct nfc_digital_dev *ddev)
        mutex_unlock(&trf->lock);
 }
 
-static struct nfc_digital_ops trf7970a_nfc_ops = {
+static const struct nfc_digital_ops trf7970a_nfc_ops = {
        .in_configure_hw        = trf7970a_in_configure_hw,
        .in_send_cmd            = trf7970a_send_cmd,
        .tg_configure_hw        = trf7970a_tg_configure_hw,
index 963db96bcbbb4c59e185adbffb0512abc1f7f517..bb3e8fdc06929b2bc88002c16e29d3c8bb69c6dd 100644 (file)
@@ -191,7 +191,7 @@ struct digital_poll_tech {
 
 struct nfc_digital_dev {
        struct nfc_dev *nfc_dev;
-       struct nfc_digital_ops *ops;
+       const struct nfc_digital_ops *ops;
 
        u32 protocols;
 
@@ -236,7 +236,7 @@ struct nfc_digital_dev {
        void (*skb_add_crc)(struct sk_buff *skb);
 };
 
-struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops,
+struct nfc_digital_dev *nfc_digital_allocate_device(const struct nfc_digital_ops *ops,
                                                    __u32 supported_protocols,
                                                    __u32 driver_capabilities,
                                                    int tx_headroom,
index 8f2572decccdf2160f59f8170bb84390f2d6f005..fefc03674f4f8333bd657d102409f5f2161ccbc2 100644 (file)
@@ -745,7 +745,7 @@ static const struct nfc_ops digital_nfc_ops = {
        .im_transceive = digital_in_send,
 };
 
-struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops,
+struct nfc_digital_dev *nfc_digital_allocate_device(const struct nfc_digital_ops *ops,
                                            __u32 supported_protocols,
                                            __u32 driver_capabilities,
                                            int tx_headroom, int tx_tailroom)