All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	alsa-devel@alsa-project.org,
	Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Subject: [PATCH 17/21] ALSA: ice1712: Remove always NULL parameters
Date: Fri,  2 Jan 2015 12:24:51 +0100	[thread overview]
Message-ID: <1420197895-17696-18-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1420197895-17696-1-git-send-email-lars@metafoo.de>

The various PCM allocation functions in this driver take a pointer to a
pointer of a PCM where if this parameter is provided the newly allocated PCM
is stored. All callers pass NULL though, so remove the parameter. This makes
the code a bit cleaner and shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/pci/ice1712/ice1712.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index b039b46..a2ee2982 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -880,13 +880,11 @@ static struct snd_pcm_ops snd_ice1712_capture_ops = {
 	.pointer =	snd_ice1712_capture_pointer,
 };
 
-static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm)
+static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device)
 {
 	struct snd_pcm *pcm;
 	int err;
 
-	if (rpcm)
-		*rpcm = NULL;
 	err = snd_pcm_new(ice->card, "ICE1712 consumer", device, 1, 1, &pcm);
 	if (err < 0)
 		return err;
@@ -902,22 +900,17 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm *
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 					      snd_dma_pci_data(ice->pci), 64*1024, 64*1024);
 
-	if (rpcm)
-		*rpcm = pcm;
-
 	dev_warn(ice->card->dev,
 		 "Consumer PCM code does not work well at the moment --jk\n");
 
 	return 0;
 }
 
-static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm)
+static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device)
 {
 	struct snd_pcm *pcm;
 	int err;
 
-	if (rpcm)
-		*rpcm = NULL;
 	err = snd_pcm_new(ice->card, "ICE1712 consumer (DS)", device, 6, 0, &pcm);
 	if (err < 0)
 		return err;
@@ -932,9 +925,6 @@ static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pc
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 					      snd_dma_pci_data(ice->pci), 64*1024, 128*1024);
 
-	if (rpcm)
-		*rpcm = pcm;
-
 	return 0;
 }
 
@@ -1260,13 +1250,11 @@ static struct snd_pcm_ops snd_ice1712_capture_pro_ops = {
 	.pointer =	snd_ice1712_capture_pro_pointer,
 };
 
-static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm)
+static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device)
 {
 	struct snd_pcm *pcm;
 	int err;
 
-	if (rpcm)
-		*rpcm = NULL;
 	err = snd_pcm_new(ice->card, "ICE1712 multi", device, 1, 1, &pcm);
 	if (err < 0)
 		return err;
@@ -1282,8 +1270,6 @@ static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd
 					      snd_dma_pci_data(ice->pci), 256*1024, 256*1024);
 
 	ice->pcm_pro = pcm;
-	if (rpcm)
-		*rpcm = pcm;
 
 	if (ice->cs8427) {
 		/* assign channels to iec958 */
@@ -2691,14 +2677,14 @@ static int snd_ice1712_probe(struct pci_dev *pci,
 	c = &no_matched;
  __found:
 
-	err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL);
+	err = snd_ice1712_pcm_profi(ice, pcm_dev++);
 	if (err < 0) {
 		snd_card_free(card);
 		return err;
 	}
 
 	if (ice_has_con_ac97(ice)) {
-		err = snd_ice1712_pcm(ice, pcm_dev++, NULL);
+		err = snd_ice1712_pcm(ice, pcm_dev++);
 		if (err < 0) {
 			snd_card_free(card);
 			return err;
@@ -2726,7 +2712,7 @@ static int snd_ice1712_probe(struct pci_dev *pci,
 	}
 
 	if (ice_has_con_ac97(ice)) {
-		err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL);
+		err = snd_ice1712_pcm_ds(ice, pcm_dev++);
 		if (err < 0) {
 			snd_card_free(card);
 			return err;
-- 
1.8.0

  parent reply	other threads:[~2015-01-02 11:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02 11:24 [PATCH 00/21] ALSA: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 01/21] ALSA: ml403-ac97cr: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 02/21] ALSA: ad1816a: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 03/21] ALSA: es1688: Remove almost always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 04/21] ALSA: es18xx: Remove " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 05/21] ALSA: gus: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 06/21] ALSA: msnd: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 07/21] ALSA: sb8: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 08/21] ASoC: sb16: Simplify snd_sb16dsp_pcm() Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 09/21] ALSA: wss: Remove (almost) always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 10/21] ASLA: ad1889: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 11/21] ALSA: asihpi: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 12/21] ALSA: cs4281: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 13/21] ALSA: cs46xx: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 14/21] ALSA: ens1370: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 15/21] ALSA: emu10k1: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 16/21] ALSA: fm801: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` Lars-Peter Clausen [this message]
2015-01-02 11:24 ` [PATCH 18/21] ALSA: riptide: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 19/21] ALSA: sonicvibes: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 20/21] ALSA: trident: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 21/21] ALSA: ymfpci: " Lars-Peter Clausen
2015-01-02 15:35 ` [PATCH 00/21] ALSA: " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420197895-17696-18-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=eliot@blennerhassett.gen.nz \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.