Util-Linux package development
 help / color / mirror / Atom feed
From: maximilian attems <max@stro.at>
To: util-linux@vger.kernel.org
Cc: maximilian attems <max@stro.at>
Subject: [PATCH] raw: fix shadowing of minor function
Date: Mon, 29 Aug 2011 18:59:35 +0200	[thread overview]
Message-ID: <1314637175-30646-1-git-send-email-max@stro.at> (raw)

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


             reply	other threads:[~2011-08-29 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 16:59 maximilian attems [this message]
2011-08-30  9:54 ` [PATCH] raw: fix shadowing of minor function Karel Zak
2011-08-31 15:17   ` maximilian attems

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314637175-30646-1-git-send-email-max@stro.at \
    --to=max@stro.at \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox