From 7f387c5c215e7208a7217d528878fb5d3b2a7b5b Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Tue, 13 Jun 2017 03:16:02 +0200 Subject: libfdisk: cleanup sun label checksum usuage We are using now the formerly unused function sun_pt_checksum(). This cleanup was motivated by clang compiler warning, see below. Also nice that we are now always using uint16_t instead of short. Warning was: ../libfdisk/src/sun.c:177:35: warning: taking address of packed member 'csum' of class or structure 'sun_disklabel' may result in an unaligned pointer value [-Waddress-of-packed-member] while(ush < (unsigned short *)(&sunlabel->csum)) Signed-off-by: Ruediger Meier --- include/pt-sun.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/pt-sun.h') diff --git a/include/pt-sun.h b/include/pt-sun.h index b085268ca..e6a4ed13f 100644 --- a/include/pt-sun.h +++ b/include/pt-sun.h @@ -76,7 +76,7 @@ struct sun_disklabel { #define SUN_FLAG_UNMNT 0x01 /* Unmountable partition*/ #define SUN_FLAG_RONLY 0x10 /* Read only */ -static inline uint16_t sun_pt_checksum(struct sun_disklabel *label) +static inline uint16_t sun_pt_checksum(const struct sun_disklabel *label) { uint16_t *ptr = ((uint16_t *) (label + 1)) - 1; uint16_t sum; -- cgit v1.2.3-55-g7522