nfc: virtual_ncidev: constify pointer to nfc_dev
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 29 Jul 2021 10:40:15 +0000 (12:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Jul 2021 11:28:03 +0000 (12:28 +0100)
virtual_ncidev_ioctl() does not modify struct nfc_dev, so local variable
can be a pointer to const.

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

index b914ab2c21095bca3865eb12d1197121595a323c..2ee0ec4bb739423868efab29a6ea21a053727fc7 100644 (file)
@@ -170,7 +170,7 @@ static int virtual_ncidev_close(struct inode *inode, struct file *file)
 static long virtual_ncidev_ioctl(struct file *flip, unsigned int cmd,
                                 unsigned long arg)
 {
-       struct nfc_dev *nfc_dev = ndev->nfc_dev;
+       const struct nfc_dev *nfc_dev = ndev->nfc_dev;
        void __user *p = (void __user *)arg;
 
        if (cmd != IOCTL_GET_NCIDEV_IDX)