Commit 15944ad2 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by David S. Miller

nfc: constify pointer to nfc_vendor_cmd

Neither the core nor the drivers modify the passed pointer to struct
nfc_vendor_cmd, so make it a pointer to const for correctness and
safety.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f20ae9b
...@@ -371,7 +371,7 @@ static int st_nci_manufacturer_specific(struct nfc_dev *dev, void *data, ...@@ -371,7 +371,7 @@ static int st_nci_manufacturer_specific(struct nfc_dev *dev, void *data,
return nfc_vendor_cmd_reply(msg); return nfc_vendor_cmd_reply(msg);
} }
static struct nfc_vendor_cmd st_nci_vendor_cmds[] = { static const struct nfc_vendor_cmd st_nci_vendor_cmds[] = {
{ {
.vendor_id = ST_NCI_VENDOR_OUI, .vendor_id = ST_NCI_VENDOR_OUI,
.subcmd = FACTORY_MODE, .subcmd = FACTORY_MODE,
......
...@@ -295,7 +295,7 @@ static int st21nfca_hci_loopback(struct nfc_dev *dev, void *data, ...@@ -295,7 +295,7 @@ static int st21nfca_hci_loopback(struct nfc_dev *dev, void *data,
return r; return r;
} }
static struct nfc_vendor_cmd st21nfca_vendor_cmds[] = { static const struct nfc_vendor_cmd st21nfca_vendor_cmds[] = {
{ {
.vendor_id = ST21NFCA_VENDOR_OUI, .vendor_id = ST21NFCA_VENDOR_OUI,
.subcmd = FACTORY_MODE, .subcmd = FACTORY_MODE,
......
...@@ -168,7 +168,7 @@ void nfc_hci_set_clientdata(struct nfc_hci_dev *hdev, void *clientdata); ...@@ -168,7 +168,7 @@ void nfc_hci_set_clientdata(struct nfc_hci_dev *hdev, void *clientdata);
void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev);
static inline int nfc_hci_set_vendor_cmds(struct nfc_hci_dev *hdev, static inline int nfc_hci_set_vendor_cmds(struct nfc_hci_dev *hdev,
struct nfc_vendor_cmd *cmds, const struct nfc_vendor_cmd *cmds,
int n_cmds) int n_cmds)
{ {
return nfc_set_vendor_cmds(hdev->ndev, cmds, n_cmds); return nfc_set_vendor_cmds(hdev->ndev, cmds, n_cmds);
......
...@@ -343,7 +343,7 @@ static inline void *nci_get_drvdata(struct nci_dev *ndev) ...@@ -343,7 +343,7 @@ static inline void *nci_get_drvdata(struct nci_dev *ndev)
} }
static inline int nci_set_vendor_cmds(struct nci_dev *ndev, static inline int nci_set_vendor_cmds(struct nci_dev *ndev,
struct nfc_vendor_cmd *cmds, const struct nfc_vendor_cmd *cmds,
int n_cmds) int n_cmds)
{ {
return nfc_set_vendor_cmds(ndev->nfc_dev, cmds, n_cmds); return nfc_set_vendor_cmds(ndev->nfc_dev, cmds, n_cmds);
......
...@@ -188,7 +188,7 @@ struct nfc_dev { ...@@ -188,7 +188,7 @@ struct nfc_dev {
struct rfkill *rfkill; struct rfkill *rfkill;
struct nfc_vendor_cmd *vendor_cmds; const struct nfc_vendor_cmd *vendor_cmds;
int n_vendor_cmds; int n_vendor_cmds;
struct nfc_ops *ops; struct nfc_ops *ops;
...@@ -297,7 +297,7 @@ void nfc_send_to_raw_sock(struct nfc_dev *dev, struct sk_buff *skb, ...@@ -297,7 +297,7 @@ void nfc_send_to_raw_sock(struct nfc_dev *dev, struct sk_buff *skb,
u8 payload_type, u8 direction); u8 payload_type, u8 direction);
static inline int nfc_set_vendor_cmds(struct nfc_dev *dev, static inline int nfc_set_vendor_cmds(struct nfc_dev *dev,
struct nfc_vendor_cmd *cmds, const struct nfc_vendor_cmd *cmds,
int n_cmds) int n_cmds)
{ {
if (dev->vendor_cmds || dev->n_vendor_cmds) if (dev->vendor_cmds || dev->n_vendor_cmds)
......
...@@ -1531,7 +1531,7 @@ static int nfc_genl_vendor_cmd(struct sk_buff *skb, ...@@ -1531,7 +1531,7 @@ static int nfc_genl_vendor_cmd(struct sk_buff *skb,
struct genl_info *info) struct genl_info *info)
{ {
struct nfc_dev *dev; struct nfc_dev *dev;
struct nfc_vendor_cmd *cmd; const struct nfc_vendor_cmd *cmd;
u32 dev_idx, vid, subcmd; u32 dev_idx, vid, subcmd;
u8 *data; u8 *data;
size_t data_len; size_t data_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment