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

nfc: constify nfc_llc_ops

Neither the core nor the drivers modify the passed pointer to struct
nfc_llc_ops, 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 094c45c8
...@@ -181,7 +181,7 @@ xmit_from_hci(): ...@@ -181,7 +181,7 @@ xmit_from_hci():
The llc must be registered with nfc before it can be used. Do that by The llc must be registered with nfc before it can be used. Do that by
calling:: calling::
nfc_llc_register(const char *name, struct nfc_llc_ops *ops); nfc_llc_register(const char *name, const struct nfc_llc_ops *ops);
Again, note that the llc does not handle the physical link. It is thus very Again, note that the llc does not handle the physical link. It is thus very
easy to mix any physical link with any llc for a given chip driver. easy to mix any physical link with any llc for a given chip driver.
......
...@@ -41,7 +41,7 @@ void nfc_llc_exit(void) ...@@ -41,7 +41,7 @@ void nfc_llc_exit(void)
} }
} }
int nfc_llc_register(const char *name, struct nfc_llc_ops *ops) int nfc_llc_register(const char *name, const struct nfc_llc_ops *ops)
{ {
struct nfc_llc_engine *llc_engine; struct nfc_llc_engine *llc_engine;
......
...@@ -26,20 +26,20 @@ struct nfc_llc_ops { ...@@ -26,20 +26,20 @@ struct nfc_llc_ops {
struct nfc_llc_engine { struct nfc_llc_engine {
const char *name; const char *name;
struct nfc_llc_ops *ops; const struct nfc_llc_ops *ops;
struct list_head entry; struct list_head entry;
}; };
struct nfc_llc { struct nfc_llc {
void *data; void *data;
struct nfc_llc_ops *ops; const struct nfc_llc_ops *ops;
int rx_headroom; int rx_headroom;
int rx_tailroom; int rx_tailroom;
}; };
void *nfc_llc_get_data(struct nfc_llc *llc); void *nfc_llc_get_data(struct nfc_llc *llc);
int nfc_llc_register(const char *name, struct nfc_llc_ops *ops); int nfc_llc_register(const char *name, const struct nfc_llc_ops *ops);
void nfc_llc_unregister(const char *name); void nfc_llc_unregister(const char *name);
int nfc_llc_nop_register(void); int nfc_llc_nop_register(void);
......
...@@ -71,7 +71,7 @@ static int llc_nop_xmit_from_hci(struct nfc_llc *llc, struct sk_buff *skb) ...@@ -71,7 +71,7 @@ static int llc_nop_xmit_from_hci(struct nfc_llc *llc, struct sk_buff *skb)
return llc_nop->xmit_to_drv(llc_nop->hdev, skb); return llc_nop->xmit_to_drv(llc_nop->hdev, skb);
} }
static struct nfc_llc_ops llc_nop_ops = { static const struct nfc_llc_ops llc_nop_ops = {
.init = llc_nop_init, .init = llc_nop_init,
.deinit = llc_nop_deinit, .deinit = llc_nop_deinit,
.start = llc_nop_start, .start = llc_nop_start,
......
...@@ -820,7 +820,7 @@ static int llc_shdlc_xmit_from_hci(struct nfc_llc *llc, struct sk_buff *skb) ...@@ -820,7 +820,7 @@ static int llc_shdlc_xmit_from_hci(struct nfc_llc *llc, struct sk_buff *skb)
return 0; return 0;
} }
static struct nfc_llc_ops llc_shdlc_ops = { static const struct nfc_llc_ops llc_shdlc_ops = {
.init = llc_shdlc_init, .init = llc_shdlc_init,
.deinit = llc_shdlc_deinit, .deinit = llc_shdlc_deinit,
.start = llc_shdlc_start, .start = llc_shdlc_start,
......
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