diff options
author | Karel Zak | 2009-10-16 01:05:45 +0200 |
---|---|---|
committer | Karel Zak | 2009-10-16 01:05:45 +0200 |
commit | 515422fdb3b0bb9473fc6c67f8654b6246240da8 (patch) | |
tree | 9e4451119b39c6073bd3997f86b2527167f17e09 /disk-utils/blockdev.c | |
parent | chrt: use c.h (diff) | |
download | kernel-qcow2-util-linux-515422fdb3b0bb9473fc6c67f8654b6246240da8.tar.gz kernel-qcow2-util-linux-515422fdb3b0bb9473fc6c67f8654b6246240da8.tar.xz kernel-qcow2-util-linux-515422fdb3b0bb9473fc6c67f8654b6246240da8.zip |
blockdev: use c.h
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/blockdev.c')
-rw-r--r-- | disk-utils/blockdev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index b20c052f3..288c102df 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -11,6 +11,7 @@ #include <sys/ioctl.h> #include <errno.h> +#include "c.h" #include "nls.h" #include "blkdev.h" @@ -171,8 +172,6 @@ struct bdc bdcms[] = } }; -#define SIZE(a) (sizeof(a)/sizeof((a)[0])) - static void usage(void) { int i; @@ -186,7 +185,7 @@ usage(void) { fprintf(stderr, _("Available commands:\n")); fprintf(stderr, "\t%-30s %s\n", "--getsz", _("get size in 512-byte sectors")); - for (i = 0; i < SIZE(bdcms); i++) { + for (i = 0; i < ARRAY_SIZE(bdcms); i++) { if (bdcms[i].argname) fprintf(stderr, "\t%s %-*s %s\n", bdcms[i].name, (int) (29 - strlen(bdcms[i].name)), @@ -203,7 +202,7 @@ static int find_cmd(char *s) { int j; - for (j = 0; j < SIZE(bdcms); j++) + for (j = 0; j < ARRAY_SIZE(bdcms); j++) if (!strcmp(s, bdcms[j].name)) return j; return -1; |