raw: fix shadowing of minor function
PATCH 1/1 raw: fix shadowing of minor function
Noticed while compiling against klibc:raw.c: In function ‘query’:
raw.c:219:16: error: called object ‘minor’ is not a function
Rename variable from minor to minor_raw.
While at it mark the functions as static and small whitespace fixes as asked by checkpatch.
--- disk-utils/raw.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
disk-utils/raw.c +7 -7
@@ -40,8 +40,8 @@ int master_fd;int raw_minor;void open_raw_ctl (void ); -int query (int minor,const char *raw_name,int quiet); -int bind (int minor,int block_major,int block_minor); +static int query (int minor_raw,const char *raw_name,int quiet); +static int bind (int minor_raw,int block_major,int block_minor);static void usage (int err)
@@ -190,7 +190,7 @@ void open_raw_ctl(void) } } -int query (int minor,const char *raw_name,int quiet) +static int query (int minor_raw,const char *raw_name,int quiet) {struct raw_config_request rq;static int has_worked =0 ;
@@ -216,10 +216,10 @@ int query(int minor, const char *raw_name, int quiet) raw_name);exit (2 ); } - minor =minor (statbuf.st_rdev); + minor_raw =minor (statbuf.st_rdev); } - rq.raw_minor = minor; + rq.raw_minor = minor_raw; err =ioctl (master_fd,RAW_GETBIND , &rq);if (err <0 ) {if (quiet && errno ==ENODEV )
@@ -242,12 +242,12 @@ int query(int minor, const char *raw_name, int quiet)return 0 ; } -int bind (int minor,int block_major,int block_minor) +static int bind (int minor_raw,int block_major,int block_minor) {struct raw_config_request rq;int err; - rq.raw_minor = minor; + rq.raw_minor = minor_raw; rq.block_major = block_major; rq.block_minor = block_minor; err =ioctl (master_fd,RAW_SETBIND , &rq);
Signature · 1 line
1.7.5.4
Karel Zak
maintainerQuoted 5 lines · maximilian attems
Noticed while compiling against klibc:
raw.c: In function ‘query’:
raw.c:219:16: error: called object ‘minor’ is not a functionRename variable from minor to
minor_raw.
raw.c: In function ‘query’:
raw.c:241:16: error: ‘minor’ undeclared (first use in this function)
Fixed, applied, thanks.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Quoted 5 lines · Karel Zak
Quoted 4 lines · maximilian attems
Noticed while compiling against klibc:
raw.c: In function ‘query’:
raw.c:219:16: error: called object ‘minor’ is not a function
Quoted 7 lines
Quoted 1 line
Rename variable from minor to
minor_raw.
raw.c: In function ‘query’:
raw.c:241:16: error: ‘minor’ undeclared (first use in this function)Fixed, applied, thanks.
uups.
thanks for fixing up!
Signature · 1 line
maks