From patchwork Mon Jan 4 01:01:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byongho Lee X-Patchwork-Id: 7944591 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 484509F88A for ; Mon, 4 Jan 2016 01:02:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D23320384 for ; Mon, 4 Jan 2016 01:02:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FE9E2038D for ; Mon, 4 Jan 2016 01:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752347AbcADBCk (ORCPT ); Sun, 3 Jan 2016 20:02:40 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33332 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752063AbcADBCE (ORCPT ); Sun, 3 Jan 2016 20:02:04 -0500 Received: by mail-pa0-f51.google.com with SMTP id cy9so188463270pac.0 for ; Sun, 03 Jan 2016 17:02:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=3VHY7XbS9HwHMc7SltpHae049ZItf2MlOBAwTx8luk4=; b=m/F1lUXRUJXeeuPB0oa8JfHA94LvsZBeC9LJnlRvPBOlbabwVYyrjiSNEjzmRUSfY0 Wim1BSHQElkTJtu0f2Llq/LNkTRjKu/RC+jJ0IGIJ+1M0r73TE94x8KDYvvIi8riB+xn ORruEm9TSCymqVZrAsZWnKE7/8xX8NdXtQ43zfETl0ZqzRwgp+vKgCrjHTRw5q0ltLLy FK0/2Vbir7H2N5UtqpX3T2OGUQ0zjn/4u3P1a1C8B4nVmlJQzVSUZBZX67PKgqktE+2O wa6OS16XLPcLt3JgX/RmX2YG32dubfhdQEjRIBpjIgdpVGTuPhWn3OK2WYrj/rJ6OU+L dVlA== X-Received: by 10.66.253.97 with SMTP id zz1mr80412077pac.106.1451869324419; Sun, 03 Jan 2016 17:02:04 -0800 (PST) Received: from arch-gct.localdomain ([175.114.213.172]) by smtp.gmail.com with ESMTPSA id 184sm45125786pfa.15.2016.01.03.17.02.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Jan 2016 17:02:03 -0800 (PST) From: Byongho Lee To: linux-btrfs@vger.kernel.org Subject: [PATCH v2 2/6] btrfs-progs: use NULL instead of 0 Date: Mon, 4 Jan 2016 10:01:30 +0900 Message-Id: <1451869294-4291-3-git-send-email-bhlee.kernel@gmail.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1451869294-4291-1-git-send-email-bhlee.kernel@gmail.com> References: <1451869294-4291-1-git-send-email-bhlee.kernel@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the code assigning 0 to pointer instead of NULL. Signed-off-by: Byongho Lee --- cmds-fi-usage.c | 12 ++++++------ props.c | 2 +- qgroup.c | 6 ++++-- utils.c | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c index 72d80278e259..852e5651db8c 100644 --- a/cmds-fi-usage.c +++ b/cmds-fi-usage.c @@ -47,7 +47,7 @@ static int add_info_to_list(struct chunk_info **info_ptr, for (j = 0 ; j < num_stripes ; j++) { int i; - struct chunk_info *p = 0; + struct chunk_info *p = NULL; struct btrfs_stripe *stripe; u64 devid; @@ -182,7 +182,7 @@ static int load_chunk_info(int fd, struct chunk_info **info_ptr, int *info_count ret = add_info_to_list(info_ptr, info_count, item); if (ret) { - *info_ptr = 0; + *info_ptr = NULL; return 1; } @@ -228,7 +228,7 @@ static int cmp_btrfs_ioctl_space_info(const void *a, const void *b) */ static struct btrfs_ioctl_space_args *load_space_info(int fd, char *path) { - struct btrfs_ioctl_space_args *sargs = 0, *sargs_orig = 0; + struct btrfs_ioctl_space_args *sargs = NULL, *sargs_orig = NULL; int e, ret, count; sargs_orig = sargs = calloc(1, sizeof(struct btrfs_ioctl_space_args)); @@ -312,7 +312,7 @@ static int print_filesystem_usage_overall(int fd, struct chunk_info *chunkinfo, int chunkcount, struct device_info *devinfo, int devcount, char *path, unsigned unit_mode) { - struct btrfs_ioctl_space_args *sargs = 0; + struct btrfs_ioctl_space_args *sargs = NULL; int i; int ret = 0; int width = 10; /* default 10 for human units */ @@ -510,7 +510,7 @@ static int load_device_info(int fd, struct device_info **device_info_ptr, struct device_info *info; *device_info_count = 0; - *device_info_ptr = 0; + *device_info_ptr = NULL; ret = ioctl(fd, BTRFS_IOC_FS_INFO, &fi_args); if (ret < 0) { @@ -620,7 +620,7 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode, { int i; u64 total_unused = 0; - struct string_table *matrix = 0; + struct string_table *matrix = NULL; int ncols, nrows; int col; int unallocated_col; diff --git a/props.c b/props.c index c9e2bd4108f8..5b7493240b09 100644 --- a/props.c +++ b/props.c @@ -194,5 +194,5 @@ const struct prop_handler prop_handlers[] = { prop_object_dev | prop_object_root, prop_label}, {"compression", "Set/get compression for a file or directory", 0, prop_object_inode, prop_compression}, - {0, 0, 0, 0, 0} + {NULL, NULL, 0, 0, NULL} }; diff --git a/qgroup.c b/qgroup.c index 1fbfcb97d659..f56f51a0e4aa 100644 --- a/qgroup.c +++ b/qgroup.c @@ -1117,7 +1117,8 @@ static int __qgroups_search(int fd, struct qgroup_lookup *qgroup_lookup) btrfs_stack_qgroup_info_exclusive_compressed (info); add_qgroup(qgroup_lookup, sh->offset, a1, a2, - a3, a4, a5, 0, 0, 0, 0, 0, 0, 0); + a3, a4, a5, 0, 0, 0, 0, 0, + NULL, NULL); } else if (sh->type == BTRFS_QGROUP_LIMIT_KEY) { limit = (struct btrfs_qgroup_limit_item *) (args.buf + off); @@ -1132,7 +1133,8 @@ static int __qgroups_search(int fd, struct qgroup_lookup *qgroup_lookup) a5 = btrfs_stack_qgroup_limit_rsv_exclusive (limit); add_qgroup(qgroup_lookup, sh->offset, 0, 0, - 0, 0, 0, a1, a2, a3, a4, a5, 0, 0); + 0, 0, 0, a1, a2, a3, a4, a5, + NULL, NULL); } else if (sh->type == BTRFS_QGROUP_RELATION_KEY) { if (sh->offset < sh->objectid) goto skip; diff --git a/utils.c b/utils.c index d5f60a420135..76a2bf4aa2a8 100644 --- a/utils.c +++ b/utils.c @@ -154,7 +154,7 @@ int test_uuid_unique(char *fs_uuid) blkid_dev dev = NULL; blkid_cache cache = NULL; - if (blkid_get_cache(&cache, 0) < 0) { + if (blkid_get_cache(&cache, NULL) < 0) { printf("ERROR: lblkid cache get failed\n"); return 1; } @@ -2602,7 +2602,7 @@ int btrfs_scan_lblkid(void) if (btrfs_scan_done) return 0; - if (blkid_get_cache(&cache, 0) < 0) { + if (blkid_get_cache(&cache, NULL) < 0) { printf("ERROR: lblkid cache get failed\n"); return 1; }