diff options
author | Ruediger Meier | 2017-06-13 03:16:02 +0200 |
---|---|---|
committer | Ruediger Meier | 2017-06-13 18:06:36 +0200 |
commit | 7f387c5c215e7208a7217d528878fb5d3b2a7b5b (patch) | |
tree | 7fe020dc1b94c17c935cec30764603dca2f8a06f /include/pt-sun.h | |
parent | lscpu: cleanup DMI detection return codes (diff) | |
download | kernel-qcow2-util-linux-7f387c5c215e7208a7217d528878fb5d3b2a7b5b.tar.gz kernel-qcow2-util-linux-7f387c5c215e7208a7217d528878fb5d3b2a7b5b.tar.xz kernel-qcow2-util-linux-7f387c5c215e7208a7217d528878fb5d3b2a7b5b.zip |
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 <ruediger.meier@ga-group.nl>
Diffstat (limited to 'include/pt-sun.h')
-rw-r--r-- | include/pt-sun.h | 2 |
1 files changed, 1 insertions, 1 deletions
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; |