linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: jsorensen@fb.com
Cc: zlliu@suse.com, linux-raid@vger.kernel.org
Subject: [mdadm PATCH 1/1] Fix a building error
Date: Tue, 19 Sep 2017 18:14:41 +0800	[thread overview]
Message-ID: <1505816081-7887-1-git-send-email-xni@redhat.com> (raw)

In s390 platform, it gives a building error:
Manage.c: In function 'Manage_subdevs':
Manage.c:1502:5: error: passing argument 3 of 'fstat_is_blkdev' from incompatible pointer type [-Werror]
     fstat_is_blkdev(tfd, dv->devname, &rdev);
     ^
In file included from Manage.c:25:0:
mdadm.h:1446:12: note: expected 'dev_t *' but argument is of type 'long unsigned int *'

It was introduced by 0a6bff09 and add a temp variable to fix this.

Signed-off-by: Xiao Ni <xni@redhat.com>
---
 Manage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Manage.c b/Manage.c
index 871d342..fbb07ce 100644
--- a/Manage.c
+++ b/Manage.c
@@ -1497,13 +1497,14 @@ int Manage_subdevs(char *devname, int fd,
 			 */
 			rdev = makedev(mj, mn);
 		} else {
+			dev_t rdev_tmp;
 			tfd = dev_open(dv->devname, O_RDONLY);
 			if (tfd >= 0) {
-				fstat_is_blkdev(tfd, dv->devname, &rdev);
+				fstat_is_blkdev(tfd, dv->devname, &rdev_tmp);
 				close(tfd);
 			} else {
 				int open_err = errno;
-				if (!stat_is_blkdev(dv->devname, &rdev)) {
+				if (!stat_is_blkdev(dv->devname, &rdev_tmp)) {
 					if (dv->disposition == 'M')
 						/* non-fatal. Also improbable */
 						continue;
@@ -1523,6 +1524,7 @@ int Manage_subdevs(char *devname, int fd,
 					goto abort;
 				}
 			}
+			rdev = (unsigned long)rdev_tmp;
 		}
 		switch(dv->disposition){
 		default:
-- 
2.7.4


             reply	other threads:[~2017-09-19 10:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 10:14 Xiao Ni [this message]
2017-09-19 10:24 ` [mdadm PATCH 1/1] Fix a building error Paul Menzel
2017-09-19 13:16   ` Xiao Ni
2017-09-19 13:33     ` Wols Lists
2017-09-19 14:00     ` Paul Menzel

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=1505816081-7887-1-git-send-email-xni@redhat.com \
    --to=xni@redhat.com \
    --cc=jsorensen@fb.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=zlliu@suse.com \
    /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;
as well as URLs for NNTP newsgroup(s).