diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-01-13 14:54:13 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-01-14 01:07:51 +0100 |
| commit | 4af3d83170fd227b177f9861d93391e3d2008d34 (patch) | |
| tree | 80473c378d385013e91951515b2a83fa996ea77f | |
| parent | a54274d28ba21e09909cc012315ffa078ef41fd8 (diff) | |
| download | passt-4af3d83170fd227b177f9861d93391e3d2008d34.tar passt-4af3d83170fd227b177f9861d93391e3d2008d34.tar.gz passt-4af3d83170fd227b177f9861d93391e3d2008d34.tar.bz2 passt-4af3d83170fd227b177f9861d93391e3d2008d34.tar.lz passt-4af3d83170fd227b177f9861d93391e3d2008d34.tar.xz passt-4af3d83170fd227b177f9861d93391e3d2008d34.tar.zst passt-4af3d83170fd227b177f9861d93391e3d2008d34.zip | |
treewide: Fix more pointers which can be const
Here are some more pointers which can be const, as reported by cppcheck
2.19.1.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | conf.c | 2 | ||||
| -rw-r--r-- | dhcpv6.c | 3 | ||||
| -rw-r--r-- | vhost_user.c | 2 |
3 files changed, 4 insertions, 3 deletions
@@ -1234,7 +1234,7 @@ dns6: * * Return: 0 on success, negative error code on failure */ -static int conf_runas(char *opt, unsigned int *uid, unsigned int *gid) +static int conf_runas(const char *opt, unsigned int *uid, unsigned int *gid) { const char *uopt, *gopt = NULL; char *sep = strchr(opt, ':'); @@ -320,7 +320,7 @@ static bool dhcpv6_opt(struct iov_tail *data, uint16_t type) static bool dhcpv6_ia_notonlink(struct iov_tail *data, struct in6_addr *la) { - int ia_types[2] = { OPT_IA_NA, OPT_IA_TA }, *ia_type; + int ia_types[2] = { OPT_IA_NA, OPT_IA_TA }; struct opt_ia_addr opt_addr_storage; const struct opt_ia_addr *opt_addr; struct iov_tail current, ia_base; @@ -330,6 +330,7 @@ static bool dhcpv6_ia_notonlink(struct iov_tail *data, struct in6_addr req_addr; struct opt_hdr h_storage; const struct opt_hdr *h; + const int *ia_type; foreach(ia_type, ia_types) { current = *data; diff --git a/vhost_user.c b/vhost_user.c index 1e320bf..9fe1241 100644 --- a/vhost_user.c +++ b/vhost_user.c @@ -442,7 +442,7 @@ static bool vu_set_mem_table_exec(struct vu_dev *vdev, for (i = 0; i < vdev->memory.nregions; i++) { struct vhost_user_memory_region *msg_region = &memory->regions[i]; struct vu_dev_region *dev_region = &vdev->memory.regions[i]; - void *mmap_addr; + const void *mmap_addr; debug("vhost-user region %d", i); debug(" guest_phys_addr: 0x%016"PRIx64, |
