public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/2] Checkpatch fixes for speakup
@ 2017-02-17  5:08 Olav Haugan
  2017-02-17  5:08 ` [PATCHv2 1/2] staging: speakup: (coding style) Simplify comparisons to NULL Olav Haugan
  2017-02-17  5:08 ` [PATCHv2 2/2] staging: speakup: (coding style) Limit line to 80 chars Olav Haugan
  0 siblings, 2 replies; 3+ messages in thread
From: Olav Haugan @ 2017-02-17  5:08 UTC (permalink / raw)
  To: kirk, chris, w.d.hubbs, samuel.thibault, gregkh
  Cc: speakup, devel, linux-kernel, Olav Haugan

v2:
-Split fixes into separate patches

Olav Haugan (2):
  staging: speakup: (coding style) Simplify comparisons to NULL
  staging: speakup: (coding style) Limit line to 80 chars

 drivers/staging/speakup/synth.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

-- 
Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCHv2 1/2] staging: speakup: (coding style) Simplify comparisons to NULL
  2017-02-17  5:08 [PATCHv2 0/2] Checkpatch fixes for speakup Olav Haugan
@ 2017-02-17  5:08 ` Olav Haugan
  2017-02-17  5:08 ` [PATCHv2 2/2] staging: speakup: (coding style) Limit line to 80 chars Olav Haugan
  1 sibling, 0 replies; 3+ messages in thread
From: Olav Haugan @ 2017-02-17  5:08 UTC (permalink / raw)
  To: kirk, chris, w.d.hubbs, samuel.thibault, gregkh
  Cc: speakup, devel, linux-kernel, Olav Haugan

Fix checkpatch check notices by simplifying comparisons to NULL.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCHv2 2/2] staging: speakup: (coding style) Limit line to 80 chars
  2017-02-17  5:08 [PATCHv2 0/2] Checkpatch fixes for speakup Olav Haugan
  2017-02-17  5:08 ` [PATCHv2 1/2] staging: speakup: (coding style) Simplify comparisons to NULL Olav Haugan
@ 2017-02-17  5:08 ` Olav Haugan
  1 sibling, 0 replies; 3+ messages in thread
From: Olav Haugan @ 2017-02-17  5:08 UTC (permalink / raw)
  To: kirk, chris, w.d.hubbs, samuel.thibault, gregkh
  Cc: speakup, devel, linux-kernel, Olav Haugan

Fix checkpatch warning about line being over 80 characters.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
---
 drivers/staging/speakup/synth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index b57315110e67..8340748ae9cb 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -406,8 +406,8 @@ static int do_synth_init(struct spk_synth *in_synth)
 		speakup_register_var(var);
 	if (!spk_quiet_boot)
 		synth_printf("%s found\n", synth->long_name);
-	if (synth->attributes.name && sysfs_create_group(speakup_kobj,
-							 &synth->attributes) < 0)
+	if (synth->attributes.name &&
+	    sysfs_create_group(speakup_kobj, &synth->attributes) < 0)
 		return -ENOMEM;
 	synth_flags = synth->flags;
 	wake_up_interruptible_all(&speakup_event);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-17  5:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-17  5:08 [PATCHv2 0/2] Checkpatch fixes for speakup Olav Haugan
2017-02-17  5:08 ` [PATCHv2 1/2] staging: speakup: (coding style) Simplify comparisons to NULL Olav Haugan
2017-02-17  5:08 ` [PATCHv2 2/2] staging: speakup: (coding style) Limit line to 80 chars Olav Haugan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox