From patchwork Wed Jun 19 17:14:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 252623 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B939C2C029D for ; Thu, 20 Jun 2013 03:15:13 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934982Ab3FSRPL (ORCPT ); Wed, 19 Jun 2013 13:15:11 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:59390 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934968Ab3FSRPJ (ORCPT ); Wed, 19 Jun 2013 13:15:09 -0400 Received: by mail-pa0-f42.google.com with SMTP id rl6so5400210pac.15 for ; Wed, 19 Jun 2013 10:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=FdrI8XXO+c2PoUbeVqXJuljEqenlRKkNXvIusZKeZnM=; b=P/+HCZuV4vRSGkrLD53CBHWV3PuQJTouPHeiS1k5heOuFymCTzpv+oQ5d7IHaMFITP 0CNBuEezTOzCpZ8bmkew1PTVQ7egP3Qg4JQMzo4kXesPmM9kb77tVOUbx3aBZs6luUHS FMITEejmqP4sx3gSG5YjxKOElh9lK9biFtw2LgM6GU4lb9O1nugVPzcwiaxk5Wntk/hc xEa4bb5PoPTGTCVp165h+d9d8qIBMX1g/0ulASmUnluCrB5B0stxs6aMarWJFxV9vViY L1yp7D9YNtCNSB0cUFEqirE2wVaXtitYUo8SkUiNtrDa1OrGaZbB5JEr4YvyB3pvEVMa wHFw== X-Received: by 10.68.232.42 with SMTP id tl10mr3765234pbc.72.1371662108971; Wed, 19 Jun 2013 10:15:08 -0700 (PDT) Received: from localhost ([111.199.170.57]) by mx.google.com with ESMTPSA id z5sm23923534pbk.0.2013.06.19.10.15.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 10:15:07 -0700 (PDT) From: Eryu Guan To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, Eryu Guan Subject: [PATCH 1/2] blkid: use proper statement instead of 0 Date: Thu, 20 Jun 2013 01:14:00 +0800 Message-Id: <1371662041-20710-1-git-send-email-guaneryu@gmail.com> X-Mailer: git-send-email 1.8.2.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 --- 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 */