From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932220AbbKBRXO (ORCPT ); Mon, 2 Nov 2015 12:23:14 -0500 Received: from smtp1.ccs.ornl.gov ([160.91.199.38]:42439 "EHLO smtp1.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077AbbKBRWW (ORCPT ); Mon, 2 Nov 2015 12:22:22 -0500 From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Oleg Drokin , Andreas Dilger Cc: Linux Kernel Mailing List , lustre-devel@lists.lustre.org, James Simmons Subject: [PATCH v2 5/7] staging: lustre: handle NULL comparisons correctly for libcfs_hash.h Date: Mon, 2 Nov 2015 12:22:11 -0500 Message-Id: <1446484933-23571-6-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove all direct NULL comparisons in libcfs_hash.h. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_hash.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 87dee16..6bd2012 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -827,7 +827,7 @@ cfs_hash_djb2_hash(const void *key, size_t size, unsigned mask) { unsigned i, hash = 5381; - LASSERT(key != NULL); + LASSERT(key); for (i = 0; i < size; i++) hash = hash * 33 + ((char *)key)[i]; @@ -855,7 +855,7 @@ cfs_hash_u64_hash(const __u64 key, unsigned mask) /** iterate over all buckets in @bds (array of struct cfs_hash_bd) */ #define cfs_hash_for_each_bd(bds, n, i) \ - for (i = 0; i < n && (bds)[i].bd_bucket != NULL; i++) + for (i = 0; i < n && (bds)[i].bd_bucket; i++) /** iterate over all buckets of @hs */ #define cfs_hash_for_each_bucket(hs, bd, pos) \ -- 1.7.1