From: Karel Zak Date: Wed, 10 Jul 2013 15:07:40 +0000 (+0200) Subject: fdisk: (bsd) minor code clean up X-Git-Tag: v2.24-rc1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bf367edf6ca485b5b51877918cefea8056427a7;p=thirdparty%2Futil-linux.git fdisk: (bsd) minor code clean up Signed-off-by: Karel Zak --- diff --git a/fdisks/fdiskbsdlabel.c b/fdisks/fdiskbsdlabel.c index 8792c50703..5b0aa5fd13 100644 --- a/fdisks/fdiskbsdlabel.c +++ b/fdisks/fdiskbsdlabel.c @@ -47,8 +47,6 @@ #include #include #include -#include -#include #include #include "nls.h" @@ -120,23 +118,11 @@ struct fdisk_bsd_label { }; static int bsd_list_disklabel(struct fdisk_context *cxt); - -static int xbsd_delete_part (struct fdisk_context *cxt, size_t partnum); -static unsigned short xbsd_dkcksum (struct bsd_disklabel *lp); static int xbsd_initlabel(struct fdisk_context *cxt); static int xbsd_readlabel(struct fdisk_context *cxt); static int xbsd_writelabel(struct fdisk_context *cxt); static void sync_disks(struct fdisk_context *cxt); -#if defined (__alpha__) -void alpha_bootblock_checksum (char *boot); -#endif - -#if !defined (__alpha__) -static int xbsd_translate_fstype (int linux_type); -#endif - - #define bsd_cround(c, n) \ (fdisk_context_use_cylinders(c) ? ((n)/self_disklabel(c)->d_secpercyl) + 1 : (n)) @@ -159,6 +145,18 @@ static inline struct bsd_disklabel *self_disklabel(struct fdisk_context *cxt) return &((struct fdisk_bsd_label *) cxt->label)->bsd; } +#if defined (__alpha__) +void alpha_bootblock_checksum (char *boot) +{ + uint64_t *dp = (uint64_t *) boot, sum = 0; + int i; + + for (i = 0; i < 63; i++) + sum += dp[i]; + dp[63] = sum; +} +#endif /* __alpha__ */ + #define HIDDEN_MASK 0x10 static int is_bsd_partition_type(int type) @@ -657,8 +655,8 @@ done: return rc; } -static unsigned short -xbsd_dkcksum (struct bsd_disklabel *lp) { +static unsigned short xbsd_dkcksum (struct bsd_disklabel *lp) +{ unsigned short *start, *end; unsigned short sum = 0; @@ -886,26 +884,6 @@ int fdisk_bsd_link_partition(struct fdisk_context *cxt) return 0; } -#if defined (__alpha__) - -#if !defined(__GLIBC__) -typedef unsigned long long u_int64_t; -#endif - -void -alpha_bootblock_checksum (char *boot) -{ - u_int64_t *dp, sum; - int i; - - dp = (u_int64_t *)boot; - sum = 0; - for (i = 0; i < 63; i++) - sum += dp[i]; - dp[63] = sum; -} -#endif /* __alpha__ */ - static struct fdisk_parttype *xbsd_get_parttype( struct fdisk_context *cxt, size_t n) diff --git a/fdisks/fdiskbsdlabel.h b/fdisks/fdiskbsdlabel.h index e06e5e9385..5ea0658be3 100644 --- a/fdisks/fdiskbsdlabel.h +++ b/fdisks/fdiskbsdlabel.h @@ -37,8 +37,6 @@ #include #include "pt-bsd.h" -extern int btrydev(struct fdisk_context *cxt); - /* public bsd specific functions */ extern int fdisk_bsd_edit_disklabel(struct fdisk_context *cxt); extern int fdisk_bsd_write_bootstrap(struct fdisk_context *cxt);