From: Karel Zak Date: Mon, 23 Jul 2018 09:43:47 +0000 (+0200) Subject: swapon: fix compiler warnings [-Wcast-qual] X-Git-Tag: v2.33-rc1~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58bc493243548a546291fe23720e9961472e3681;p=thirdparty%2Futil-linux.git swapon: fix compiler warnings [-Wcast-qual] Signed-off-by: Karel Zak --- diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 4ef2f1c9da..357dcb3f74 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -462,12 +462,12 @@ static unsigned long long swap_get_size(const struct swap_device *dev, { unsigned int last_page = 0; const unsigned int swap_version = SWAP_VERSION; - struct swap_header_v1_2 *s; + const struct swap_header_v1_2 *s; assert(dev); assert(dev->pagesize > 0); - s = (struct swap_header_v1_2 *) hdr; + s = (const struct swap_header_v1_2 *) hdr; if (s->version == swap_version) last_page = s->last_page; @@ -479,7 +479,7 @@ static unsigned long long swap_get_size(const struct swap_device *dev, static void swap_get_info(struct swap_device *dev, const char *hdr) { - struct swap_header_v1_2 *s = (struct swap_header_v1_2 *) hdr; + const struct swap_header_v1_2 *s = (const struct swap_header_v1_2 *) hdr; assert(dev);