diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-24 23:47:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-25 09:21:20 +0100 |
commit | b9c28286d8f1822a10f702fcefe0b8a1db4e6917 (patch) | |
tree | 4220028d575e0cac82c578cd243e31947e8df0c3 /drivers/nfc/nfcmrvl | |
parent | 48d5440393d328cfe18b26e3609c84c0f41d6515 (diff) |
nfc: constify nci_ops
The struct nci_ops is modified by NFC core in only one case:
nci_allocate_device() receives too many proprietary commands (prop_ops)
to configure. This is a build time known constrain, so a graceful
handling of such case is not necessary.
Instead, fail the nci_allocate_device() and add BUILD_BUG_ON() to places
which set these.
This allows to constify the struct nci_ops (consisting of function
pointers) for correctness and safety.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/nfc/nfcmrvl')
-rw-r--r-- | drivers/nfc/nfcmrvl/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c index a4620b480c4f..6e9e7ce8792c 100644 --- a/drivers/nfc/nfcmrvl/main.c +++ b/drivers/nfc/nfcmrvl/main.c @@ -81,7 +81,7 @@ static int nfcmrvl_nci_fw_download(struct nci_dev *ndev, return nfcmrvl_fw_dnld_start(ndev, firmware_name); } -static struct nci_ops nfcmrvl_nci_ops = { +static const struct nci_ops nfcmrvl_nci_ops = { .open = nfcmrvl_nci_open, .close = nfcmrvl_nci_close, .send = nfcmrvl_nci_send, |