linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Eryu Guan <guaneryu@gmail.com>
Subject: [PATCH 1/2] blkid: use proper statement instead of 0
Date: Thu, 20 Jun 2013 01:14:00 +0800	[thread overview]
Message-ID: <1371662041-20710-1-git-send-email-guaneryu@gmail.com> (raw)

NULL for pointers and '\0' for chars are more proper than 0.

Also fix a comment to match the code, bic_list should be bic_devs.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
---
 lib/blkid/blkidP.h | 2 +-
 lib/blkid/cache.c  | 2 +-
 lib/blkid/read.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/blkid/blkidP.h b/lib/blkid/blkidP.h
index e0f11a0..a99b242 100644
--- a/lib/blkid/blkidP.h
+++ b/lib/blkid/blkidP.h
@@ -83,7 +83,7 @@ typedef struct blkid_struct_tag *blkid_tag;
 #define BLKID_PROBE_INTERVAL	200
 
 /* This describes an entire blkid cache file and probed devices.
- * We can traverse all of the found devices via bic_list.
+ * We can traverse all of the found devices via bic_devs.
  * We can traverse all of the tag types by bic_tags, which hold empty tags
  * for each tag type.  Those tags can be used as list_heads for iterating
  * through all devices with a specific tag type (e.g. LABEL).
diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c
index 8bdd239..1b6a86d 100644
--- a/lib/blkid/cache.c
+++ b/lib/blkid/cache.c
@@ -105,7 +105,7 @@ int blkid_get_cache(blkid_cache *ret_cache, const char *filename)
 	INIT_LIST_HEAD(&cache->bic_tags);
 
 	if (filename && !strlen(filename))
-		filename = 0;
+		filename = NULL;
 	if (!filename)
 		filename = safe_getenv("BLKID_FILE");
 	if (!filename)
diff --git a/lib/blkid/read.c b/lib/blkid/read.c
index efc348b..f182235 100644
--- a/lib/blkid/read.c
+++ b/lib/blkid/read.c
@@ -415,7 +415,7 @@ void blkid_read_cache(blkid_cache cache)
 		unsigned int end;
 
 		lineno++;
-		if (buf[0] == 0)
+		if (buf[0] == '\0')
 			continue;
 		end = strlen(buf) - 1;
 		/* Continue reading next line if it ends with a backslash */
-- 
1.8.2.1


             reply	other threads:[~2013-06-19 17:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 17:14 Eryu Guan [this message]
2013-06-19 17:14 ` [PATCH 2/2] blkid: fix broken garbage collection Eryu Guan

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=1371662041-20710-1-git-send-email-guaneryu@gmail.com \
    --to=guaneryu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).