From 5497ba0442a78615ae9ada765c5d68d26eae82fc Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 12 Jun 2013 17:16:39 +0200 Subject: [PATCH] fdisk: move get_nr_sects() fdisk.h Signed-off-by: Karel Zak --- fdisks/fdisk.c | 4 ---- fdisks/fdisk.h | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c index 051198161c..0087c235e4 100644 --- a/fdisks/fdisk.c +++ b/fdisks/fdisk.c @@ -47,10 +47,6 @@ #endif -sector_t get_nr_sects(struct partition *p) { - return read4_little_endian(p->size4); -} - int nowarn = 0; /* no warnings for fdisk -l/-s */ void toggle_units(struct fdisk_context *cxt) diff --git a/fdisks/fdisk.h b/fdisks/fdisk.h index 7ecfa25698..3f4bbdb788 100644 --- a/fdisks/fdisk.h +++ b/fdisks/fdisk.h @@ -86,8 +86,6 @@ extern unsigned int read_int_with_suffix(struct fdisk_context *cxt, unsigned int low, unsigned int dflt, unsigned int high, unsigned int base, char *mesg, int *is_suffix_used); -extern sector_t get_nr_sects(struct partition *p); - extern int nowarn; /* start_sect and nr_sects are stored little endian on all machines */ @@ -107,6 +105,11 @@ static inline unsigned int read4_little_endian(const unsigned char *cp) + ((unsigned int)(cp[3]) << 24); } +static inline sector_t get_nr_sects(struct partition *p) +{ + return read4_little_endian(p->size4); +} + static inline void set_nr_sects(struct partition *p, sector_t nr_sects) { store4_little_endian(p->size4, nr_sects); -- 2.47.3