aboutgitcodebugslistschat
path: root/pasta.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-09-29 15:50:19 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-10-04 23:23:35 +0200
commit6471c7d01b0aad9d144448290557fcd783562228 (patch)
tree07c664f50790f205080f64d02a2b860f3642e8f7 /pasta.c
parentfc8f0f8c48ef12edbf60f74f37024917f5812385 (diff)
downloadpasst-6471c7d01b0aad9d144448290557fcd783562228.tar
passt-6471c7d01b0aad9d144448290557fcd783562228.tar.gz
passt-6471c7d01b0aad9d144448290557fcd783562228.tar.bz2
passt-6471c7d01b0aad9d144448290557fcd783562228.tar.lz
passt-6471c7d01b0aad9d144448290557fcd783562228.tar.xz
passt-6471c7d01b0aad9d144448290557fcd783562228.tar.zst
passt-6471c7d01b0aad9d144448290557fcd783562228.zip
cppcheck: Make many pointers const
Newer versions of cppcheck (as of 2.12.0, at least) added a warning for pointers which could be declared to point at const data, but aren't. Based on that, make many pointers throughout the codebase const. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'pasta.c')
-rw-r--r--pasta.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pasta.c b/pasta.c
index 9bc26d5..5fd44fe 100644
--- a/pasta.c
+++ b/pasta.c
@@ -362,7 +362,7 @@ void pasta_ns_conf(struct ctx *c)
*
* Return: inotify file descriptor, -1 on failure or if not needed/applicable
*/
-int pasta_netns_quit_init(struct ctx *c)
+int pasta_netns_quit_init(const struct ctx *c)
{
int flags = O_NONBLOCK | O_CLOEXEC;
union epoll_ref ref = { .type = EPOLL_TYPE_NSQUIT };
@@ -399,7 +399,7 @@ int pasta_netns_quit_init(struct ctx *c)
void pasta_netns_quit_handler(struct ctx *c, int inotify_fd)
{
char buf[sizeof(struct inotify_event) + NAME_MAX + 1];
- struct inotify_event *in_ev = (struct inotify_event *)buf;
+ const struct inotify_event *in_ev = (struct inotify_event *)buf;
if (read(inotify_fd, buf, sizeof(buf)) < (ssize_t)sizeof(*in_ev))
return;