From: Karel Zak Date: Fri, 31 May 2013 09:49:42 +0000 (+0200) Subject: fdisk: (sgi) small coding style changes X-Git-Tag: v2.24-rc1~212 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38859cf52d1a6448d934b47f52c35d03609e2cb1;p=thirdparty%2Futil-linux.git fdisk: (sgi) small coding style changes Signed-off-by: Karel Zak --- diff --git a/fdisks/fdisksgilabel.c b/fdisks/fdisksgilabel.c index df271039f3..57e5bf294a 100644 --- a/fdisks/fdisksgilabel.c +++ b/fdisks/fdisksgilabel.c @@ -1,39 +1,24 @@ /* * - * fdisksgilabel.c + * Copyright (C) 2012 Davidlohr Bueso + * 2013 Karel Zak * - * Copyright (C) Andreas Neuper, Sep 1998. - * This file may be modified and redistributed under - * the terms of the GNU Public License. + * This is re-written version for libfdisk, the original was fdisksgilabel.c + * from util-linux fdisk, by: * - * 1999-03-20 Arnaldo Carvalho de Melo - * Internationalization - * - * 2003-03-20 Phillip Kesling - * Some fixes - * - * 2012-06-16 Davidlohr Bueso - * Adapt to fdisk context and add heap sort for partitions + * Andreas Neuper, Sep 1998. + * Arnaldo Carvalho de Melo , Mar 1999 + * Phillip Kesling , Mar 2003 */ - -#include /* stderr */ -#include /* exit */ -#include /* strstr */ -#include /* write */ -#include /* ioctl */ -#include /* stat */ -#include /* assert */ - +#include "c.h" #include "nls.h" #include "all-io.h" -#include "xalloc.h" #include "blkdev.h" #include "bitops.h" #include "pt-sgi.h" #include "pt-mbr.h" -#include "common.h" #include "fdisk.h" #include "fdisksgilabel.h" @@ -170,9 +155,9 @@ static void add_to_freelist(struct fdisk_context *cxt, unsigned int f, unsigned int l) { struct fdisk_sgi_label *sgi = self_label(cxt); - size_t i = 0; + size_t i; - for ( ; i < ARRAY_SIZE(sgi->freelist); i++) { + for (i = 0; i < ARRAY_SIZE(sgi->freelist); i++) { if (sgi->freelist[i].last == 0) break; } @@ -255,8 +240,7 @@ static int sgi_probe_label(struct fdisk_context *cxt) return 1; } -void -sgi_list_table(struct fdisk_context *cxt, int xtra) +void sgi_list_table(struct fdisk_context *cxt, int xtra) { struct sgi_disklabel *sgilabel = self_disklabel(cxt); struct sgi_device_parameter *sgiparam = &sgilabel->devparam; @@ -473,8 +457,9 @@ err: return -errno; } -static int -compare_start(struct fdisk_context *cxt, const void *x, const void *y) { +static int compare_start(struct fdisk_context *cxt, + const void *x, const void *y) +{ /* * sort according to start sectors * and prefers largest partition: @@ -679,8 +664,8 @@ static int sgi_verify_disklabel(struct fdisk_context *cxt) return verify_disklabel(cxt, 1); } -static int -sgi_gaps(struct fdisk_context *cxt) { +static int sgi_gaps(struct fdisk_context *cxt) +{ /* * returned value is: * = 0 : disk is properly filled to the rim @@ -690,13 +675,12 @@ sgi_gaps(struct fdisk_context *cxt) { return verify_disklabel(cxt, 0); } - /* returns partition index of first entry marked as entire disk */ -static int -sgi_entire(struct fdisk_context *cxt) { - int i; +static int sgi_entire(struct fdisk_context *cxt) +{ + size_t i - for (i=0; i<16; i++) + for (i = 0; i < SGI_MAXPARTITIONS; i++) if (sgi_get_sysid(cxt, i) == SGI_TYPE_ENTIRE_DISK) return i; return -1; @@ -728,8 +712,8 @@ static int sgi_set_partition(struct fdisk_context *cxt, size_t i, return 0; } -static void -sgi_set_entire(struct fdisk_context *cxt) { +static void sgi_set_entire(struct fdisk_context *cxt) +{ size_t n; for (n = 10; n < cxt->label->nparts_max; n++) { @@ -740,9 +724,7 @@ sgi_set_entire(struct fdisk_context *cxt) { } } -static -void -sgi_set_volhdr(struct fdisk_context *cxt) +static void sgi_set_volhdr(struct fdisk_context *cxt) { size_t n; @@ -1006,32 +988,27 @@ static int sgi_create_disklabel(struct fdisk_context *cxt) return 0; } -void -sgi_set_ilfact(void) +void sgi_set_ilfact(void) { /* do nothing in the beginning */ } -void -sgi_set_rspeed(void) +void sgi_set_rspeed(void) { /* do nothing in the beginning */ } -void -sgi_set_pcylcount(void) +void sgi_set_pcylcount(void) { /* do nothing in the beginning */ } -void -sgi_set_xcyl(void) +void sgi_set_xcyl(void) { /* do nothing in the beginning */ } -void -sgi_set_ncyl(void) +void sgi_set_ncyl(void) { /* do nothing in the beginning */ }