public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: xfs@oss.sgi.com
Subject: [PATCH] xfsdump: cleanup _rmt_dev
Date: Sat, 6 Dec 2008 05:27:09 -0500	[thread overview]
Message-ID: <20081206102709.GB30364@infradead.org> (raw)

Rewrite _rmt_dev to be proper ANSI C and readable.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs-cmds/xfsdump/librmt/rmtdev.c
===================================================================
--- xfs-cmds.orig/xfsdump/librmt/rmtdev.c	2008-11-25 16:39:45.000000000 +0530
+++ xfs-cmds/xfsdump/librmt/rmtdev.c	2008-11-25 16:41:06.000000000 +0530
@@ -28,18 +28,12 @@
  *	is any string that contains ":/dev/".  Returns 1 if remote,
  *	0 otherwise.
  */
-
-int _rmt_dev (path)
-register char *path;
+int _rmt_dev(char *path)
 {
-	if ((path = strchr (path, ':')) != (char *)0)
-	{
-		if (strncmp (path + 1, "/dev/", 5) == 0)
-		{
-			return (1);
-		}
-	}
-	return (0);
-}
-
+	char *c;
 
+	c = strchr(path, ':');
+	if (c && strncmp(c + 1, "/dev/", 5) == 0)
+		return 1;
+	return 0;
+}

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2008-12-06 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-06 10:27 Christoph Hellwig [this message]
2008-12-09 10:16 ` [PATCH] xfsdump: cleanup _rmt_dev Christoph Hellwig

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=20081206102709.GB30364@infradead.org \
    --to=hch@infradead.org \
    --cc=xfs@oss.sgi.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