[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ae3600a-0a71-a957-15b2-f31e0ffab912@users.sourceforge.net>
Date: Sat, 12 Aug 2017 15:42:24 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: alsa-devel@...a-project.org, Jaroslav Kysela <perex@...ex.cz>,
Julia Lawall <Julia.Lawall@...6.fr>,
Takashi Iwai <tiwai@...e.com>,
Takashi Sakamoto <o-takashi@...amocchi.jp>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] ALSA: rme96: Adjust five checks for null pointers
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 12 Aug 2017 15:18:56 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
sound/pci/rme96.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 0cdfd53b7796..b488d74c3b99 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -1199,7 +1199,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
snd_pcm_set_sync(substream);
spin_lock_irq(&rme96->lock);
- if (rme96->playback_substream != NULL) {
+ if (rme96->playback_substream) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
}
@@ -1248,7 +1248,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
}
spin_lock_irq(&rme96->lock);
- if (rme96->capture_substream != NULL) {
+ if (rme96->capture_substream) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
}
@@ -1268,7 +1268,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
snd_pcm_set_sync(substream);
spin_lock_irq(&rme96->lock);
- if (rme96->playback_substream != NULL) {
+ if (rme96->playback_substream) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
}
@@ -1315,7 +1315,7 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
}
spin_lock_irq(&rme96->lock);
- if (rme96->capture_substream != NULL) {
+ if (rme96->capture_substream) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
}
@@ -1578,9 +1578,9 @@ snd_rme96_free(void *private_data)
{
struct rme96 *rme96 = (struct rme96 *)private_data;
- if (rme96 == NULL) {
+ if (!rme96)
return;
- }
+
if (rme96->irq >= 0) {
snd_rme96_trigger(rme96, RME96_STOP_BOTH);
rme96->areg &= ~RME96_AR_DAC_EN;
--
2.14.0
Powered by blists - more mailing lists