]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: (bsd) minor code clean up
authorKarel Zak <kzak@redhat.com>
Wed, 10 Jul 2013 15:07:40 +0000 (17:07 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Sep 2013 14:47:07 +0000 (16:47 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/fdiskbsdlabel.c
fdisks/fdiskbsdlabel.h

index 8792c507030597b75667b9cce3844b5f7c22c3d2..5b0aa5fd13561d24f4ef8b67168808b87244e749 100644 (file)
@@ -47,8 +47,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
-#include <ctype.h>
-#include <setjmp.h>
 #include <errno.h>
 #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)
index e06e5e938561e460cb9f327c0d01dde75a391641..5ea0658be3500879444e272854aa129e6696452c 100644 (file)
@@ -37,8 +37,6 @@
 #include <stdint.h>
 #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);