From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755415AbdBQFJO (ORCPT ); Fri, 17 Feb 2017 00:09:14 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:50114 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752766AbdBQFJL (ORCPT ); Fri, 17 Feb 2017 00:09:11 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CAB4A60AEE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ohaugan@codeaurora.org From: Olav Haugan To: kirk@reisers.ca, chris@the-brannons.com, w.d.hubbs@gmail.com, samuel.thibault@ens-lyon.org, gregkh@linuxfoundation.org Cc: speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Olav Haugan Subject: [PATCHv2 1/2] staging: speakup: (coding style) Simplify comparisons to NULL Date: Thu, 16 Feb 2017 21:08:31 -0800 Message-Id: <20170217050832.9923-2-ohaugan@codeaurora.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170217050832.9923-1-ohaugan@codeaurora.org> References: <20170217050832.9923-1-ohaugan@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix checkpatch check notices by simplifying comparisons to NULL. Signed-off-by: Olav Haugan --- drivers/staging/speakup/synth.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c index a61c02ba06da..b57315110e67 100644 --- a/drivers/staging/speakup/synth.c +++ b/drivers/staging/speakup/synth.c @@ -51,7 +51,7 @@ int spk_serial_synth_probe(struct spk_synth *synth) if ((synth->ser >= SPK_LO_TTY) && (synth->ser <= SPK_HI_TTY)) { ser = spk_serial_init(synth->ser); - if (ser == NULL) { + if (!ser) { failed = -1; } else { outb_p(0, ser->port); @@ -272,7 +272,7 @@ void spk_reset_index_count(int sc) int synth_supports_indexing(void) { - if (synth->get_index != NULL) + if (synth->get_index) return 1; return 0; } @@ -350,7 +350,7 @@ int synth_init(char *synth_name) int ret = 0; struct spk_synth *synth = NULL; - if (synth_name == NULL) + if (!synth_name) return 0; if (strcmp(synth_name, "none") == 0) { @@ -362,7 +362,7 @@ int synth_init(char *synth_name) mutex_lock(&spk_mutex); /* First, check if we already have it loaded. */ - for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++) + for (i = 0; i < MAXSYNTHS && synths[i]; i++) if (strcmp(synths[i]->name, synth_name) == 0) synth = synths[i]; @@ -421,7 +421,7 @@ void synth_release(void) struct var_t *var; unsigned long flags; - if (synth == NULL) + if (!synth) return; spin_lock_irqsave(&speakup_info.spinlock, flags); pr_info("releasing synth %s\n", synth->name); @@ -444,7 +444,7 @@ int synth_add(struct spk_synth *in_synth) int status = 0; mutex_lock(&spk_mutex); - for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++) + for (i = 0; i < MAXSYNTHS && synths[i]; i++) /* synth_remove() is responsible for rotating the array down */ if (in_synth == synths[i]) { mutex_unlock(&spk_mutex); @@ -471,11 +471,11 @@ void synth_remove(struct spk_synth *in_synth) mutex_lock(&spk_mutex); if (synth == in_synth) synth_release(); - for (i = 0; synths[i] != NULL; i++) { + for (i = 0; synths[i]; i++) { if (in_synth == synths[i]) break; } - for ( ; synths[i] != NULL; i++) /* compress table */ + for ( ; synths[i]; i++) /* compress table */ synths[i] = synths[i + 1]; module_status = 0; mutex_unlock(&spk_mutex); -- 2.11.0