* [PATCH] raw: fix shadowing of minor function
@ 2011-08-29 16:59 maximilian attems
2011-08-30 9:54 ` Karel Zak
0 siblings, 1 reply; 3+ messages in thread
From: maximilian attems @ 2011-08-29 16:59 UTC (permalink / raw)
To: util-linux; +Cc: maximilian attems
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.
Signed-off-by: maximilian attems <max@stro.at>
---
disk-utils/raw.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/disk-utils/raw.c b/disk-utils/raw.c
index c2c1a3e..88f2211 100644
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -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);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] raw: fix shadowing of minor function
2011-08-29 16:59 [PATCH] raw: fix shadowing of minor function maximilian attems
@ 2011-08-30 9:54 ` Karel Zak
2011-08-31 15:17 ` maximilian attems
0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2011-08-30 9:54 UTC (permalink / raw)
To: maximilian attems; +Cc: util-linux
On Mon, Aug 29, 2011 at 06:59:35PM +0200, maximilian attems wrote:
> 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.
raw.c: In function ‘query’:
raw.c:241:16: error: ‘minor’ undeclared (first use in this function)
Fixed, applied, thanks.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] raw: fix shadowing of minor function
2011-08-30 9:54 ` Karel Zak
@ 2011-08-31 15:17 ` maximilian attems
0 siblings, 0 replies; 3+ messages in thread
From: maximilian attems @ 2011-08-31 15:17 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
On Tue, Aug 30, 2011 at 11:54:12AM +0200, Karel Zak wrote:
> On Mon, Aug 29, 2011 at 06:59:35PM +0200, maximilian attems wrote:
> > 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.
>
> 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!
--
maks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-31 15:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-29 16:59 [PATCH] raw: fix shadowing of minor function maximilian attems
2011-08-30 9:54 ` Karel Zak
2011-08-31 15:17 ` maximilian attems
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.