diff options
author | Geoff Levand <geoff@infradead.org> | 2020-12-14 21:15:47 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-16 11:06:49 -0800 |
commit | c18e68696fdd9fd293f051030bce5aaff3c9b185 (patch) | |
tree | 5a1b9720ff2503554377e8c3d7cc9966400f4d6f /drivers/connector/connector.c | |
parent | 4375ada01963d1ebf733d60d1bb6e5db401e1ac6 (diff) | |
download | linux-c18e68696fdd9fd293f051030bce5aaff3c9b185.tar.gz linux-c18e68696fdd9fd293f051030bce5aaff3c9b185.tar.bz2 linux-c18e68696fdd9fd293f051030bce5aaff3c9b185.zip |
net/connector: Add const qualifier to cb_id
The connector driver never modifies any cb_id passed to it, so add a const
qualifier to those arguments so callers can declare their struct cb_id as a
constant object.
Fixes build warnings like these when passing a constant struct cb_id:
warning: passing argument 1 of ‘cn_add_callback’ discards ‘const’ qualifier from pointer target
Signed-off-by: Geoff Levand <geoff@infradead.org>
Link: https://lore.kernel.org/r/a9e49c9e-67fa-16e7-0a6b-72f6bd30c58a@infradead.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/connector/connector.c')
-rw-r--r-- | drivers/connector/connector.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index 7d59d18c6f26..48ec7ce6ecac 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c @@ -193,7 +193,7 @@ static void cn_rx_skb(struct sk_buff *skb) * * May sleep. */ -int cn_add_callback(struct cb_id *id, const char *name, +int cn_add_callback(const struct cb_id *id, const char *name, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) { @@ -214,7 +214,7 @@ EXPORT_SYMBOL_GPL(cn_add_callback); * * May sleep while waiting for reference counter to become zero. */ -void cn_del_callback(struct cb_id *id) +void cn_del_callback(const struct cb_id *id) { struct cn_dev *dev = &cdev; |