summaryrefslogtreecommitdiff
path: root/drivers/connector/cn_queue.c
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2020-12-15 08:15:47 +0300
committerJakub Kicinski <kuba@kernel.org>2020-12-16 22:06:49 +0300
commitc18e68696fdd9fd293f051030bce5aaff3c9b185 (patch)
tree5a1b9720ff2503554377e8c3d7cc9966400f4d6f /drivers/connector/cn_queue.c
parent4375ada01963d1ebf733d60d1bb6e5db401e1ac6 (diff)
downloadlinux-c18e68696fdd9fd293f051030bce5aaff3c9b185.tar.xz
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/cn_queue.c')
-rw-r--r--drivers/connector/cn_queue.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index 49295052ba8b..996f025eb63c 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -19,7 +19,7 @@
static struct cn_callback_entry *
cn_queue_alloc_callback_entry(struct cn_queue_dev *dev, const char *name,
- struct cb_id *id,
+ const struct cb_id *id,
void (*callback)(struct cn_msg *,
struct netlink_skb_parms *))
{
@@ -51,13 +51,13 @@ void cn_queue_release_callback(struct cn_callback_entry *cbq)
kfree(cbq);
}
-int cn_cb_equal(struct cb_id *i1, struct cb_id *i2)
+int cn_cb_equal(const struct cb_id *i1, const struct cb_id *i2)
{
return ((i1->idx == i2->idx) && (i1->val == i2->val));
}
int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name,
- struct cb_id *id,
+ const struct cb_id *id,
void (*callback)(struct cn_msg *,
struct netlink_skb_parms *))
{
@@ -90,7 +90,7 @@ int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name,
return 0;
}
-void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id)
+void cn_queue_del_callback(struct cn_queue_dev *dev, const struct cb_id *id)
{
struct cn_callback_entry *cbq, *n;
int found = 0;