Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933575AbcLMOxC (ORCPT ); Tue, 13 Dec 2016 09:53:02 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33209 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932414AbcLMOvo (ORCPT ); Tue, 13 Dec 2016 09:51:44 -0500 From: Corentin Labbe To: mpm@selenic.com, herbert@gondor.apana.org.au, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v2 2/7] hwrng: core: rewrite better comparison to NULL Date: Tue, 13 Dec 2016 15:51:10 +0100 Message-Id: <20161213145115.30082-2-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161213145115.30082-1-clabbe.montjoie@gmail.com> References: <20161213145115.30082-1-clabbe.montjoie@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 707 Lines: 23 This patch fix the checkpatch warning "Comparison to NULL could be written "!ptr" Signed-off-by: Corentin Labbe --- drivers/char/hw_random/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 00cbb81..7029246 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -439,8 +439,7 @@ int hwrng_register(struct hwrng *rng) int err = -EINVAL; struct hwrng *old_rng, *tmp; - if (rng->name == NULL || - (rng->data_read == NULL && rng->read == NULL)) + if (!rng->name || (!rng->data_read && !rng->read)) goto out; mutex_lock(&rng_mutex); -- 2.10.2