linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Gaston Gonzalez <gascoar@gmail.com>
To: linux-staging@lists.linux.dev
Cc: gregkh@linuxfoundation.org, nsaenz@kernel.org,
	f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com,
	bcm-kernel-feedback-list@broadcom.com,
	juerg.haefliger@canonical.com, rdunlap@infradead.org,
	dave.stevenson@raspberrypi.com, stefan.wahren@i2se.com,
	unixbhaskar@gmail.com, mitaliborkar810@gmail.com,
	phil@raspberrypi.com, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, gascoar@gmail.com
Subject: [PATCH 1/4] staging: vc04_services: avoid the use of typedef for function pointers
Date: Mon, 20 Dec 2021 18:29:11 -0300	[thread overview]
Message-ID: <ae3e8feaf7aa72a85f2e901a31bb382acf8a1ed3.1639858361.git.gascoar@gmail.com> (raw)
In-Reply-To: <cover.1639858361.git.gascoar@gmail.com>

Replace typedefs bcm2835_audio_newpcm_func and bcm2835_audio_newctl_func
with equivalent declarations to better align with the linux kernel
coding style.

As the '_func' in the function names is somehow reduntant, it was
dropped in favour of the shorter names: 'bcm2835_audio_newpcm' and
'bcm2835_audio_newctl'

Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
 .../vc04_services/bcm2835-audio/bcm2835.c     | 28 ++++++++-----------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
index c250fbef2fa3..412342d5b6c9 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
@@ -52,20 +52,14 @@ static int bcm2835_devm_add_vchi_ctx(struct device *dev)
 	return 0;
 }
 
-typedef int (*bcm2835_audio_newpcm_func)(struct bcm2835_chip *chip,
-					 const char *name,
-					 enum snd_bcm2835_route route,
-					 u32 numchannels);
-
-typedef int (*bcm2835_audio_newctl_func)(struct bcm2835_chip *chip);
-
 struct bcm2835_audio_driver {
 	struct device_driver driver;
 	const char *shortname;
 	const char *longname;
 	int minchannels;
-	bcm2835_audio_newpcm_func newpcm;
-	bcm2835_audio_newctl_func newctl;
+	int (*bcm2835_audio_newpcm)(struct bcm2835_chip *chip, const char *name,
+				    enum snd_bcm2835_route route, u32 numchannels);
+	int (*bcm2835_audio_newctl)(struct bcm2835_chip *chip);
 	enum snd_bcm2835_route route;
 };
 
@@ -104,8 +98,8 @@ static struct bcm2835_audio_driver bcm2835_audio_alsa = {
 	.shortname = "bcm2835 ALSA",
 	.longname  = "bcm2835 ALSA",
 	.minchannels = 2,
-	.newpcm = bcm2835_audio_alsa_newpcm,
-	.newctl = snd_bcm2835_new_ctl,
+	.bcm2835_audio_newpcm = bcm2835_audio_alsa_newpcm,
+	.bcm2835_audio_newctl = snd_bcm2835_new_ctl,
 };
 
 static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
@@ -116,8 +110,8 @@ static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
 	.shortname = "bcm2835 HDMI",
 	.longname  = "bcm2835 HDMI",
 	.minchannels = 1,
-	.newpcm = bcm2835_audio_simple_newpcm,
-	.newctl = snd_bcm2835_new_hdmi_ctl,
+	.bcm2835_audio_newpcm = bcm2835_audio_simple_newpcm,
+	.bcm2835_audio_newctl = snd_bcm2835_new_hdmi_ctl,
 	.route = AUDIO_DEST_HDMI
 };
 
@@ -129,8 +123,8 @@ static struct bcm2835_audio_driver bcm2835_audio_headphones = {
 	.shortname = "bcm2835 Headphones",
 	.longname  = "bcm2835 Headphones",
 	.minchannels = 1,
-	.newpcm = bcm2835_audio_simple_newpcm,
-	.newctl = snd_bcm2835_new_headphones_ctl,
+	.bcm2835_audio_newpcm = bcm2835_audio_simple_newpcm,
+	.bcm2835_audio_newctl = snd_bcm2835_new_headphones_ctl,
 	.route = AUDIO_DEST_HEADPHONES
 };
 
@@ -189,7 +183,7 @@ static int snd_add_child_device(struct device *dev,
 	strscpy(card->shortname, audio_driver->shortname, sizeof(card->shortname));
 	strscpy(card->longname, audio_driver->longname, sizeof(card->longname));
 
-	err = audio_driver->newpcm(chip, audio_driver->shortname,
+	err = audio_driver->bcm2835_audio_newpcm(chip, audio_driver->shortname,
 		audio_driver->route,
 		numchans);
 	if (err) {
@@ -197,7 +191,7 @@ static int snd_add_child_device(struct device *dev,
 		goto error;
 	}
 
-	err = audio_driver->newctl(chip);
+	err = audio_driver->bcm2835_audio_newctl(chip);
 	if (err) {
 		dev_err(dev, "Failed to create controls, error %d\n", err);
 		goto error;
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-12-20 21:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 21:29 [PATCH 0/4] staging: vc04_services: avoid the use of typedef for function pointers Gaston Gonzalez
2021-12-20 21:29 ` Gaston Gonzalez [this message]
2021-12-20 21:29 ` [PATCH 2/4] " Gaston Gonzalez
2021-12-20 23:28   ` Stefan Wahren
2021-12-21  6:19   ` Greg KH
2021-12-21 20:41     ` Gaston Gonzalez
2021-12-20 21:29 ` [PATCH 3/4] " Gaston Gonzalez
2021-12-21  6:22   ` Greg KH
2021-12-21 20:43     ` Gaston Gonzalez
2021-12-20 21:29 ` [PATCH 4/4] staging: vc04_services: update TODO file Gaston Gonzalez
2021-12-21  6:20 ` [PATCH 0/4] staging: vc04_services: avoid the use of typedef for function pointers Greg KH
2021-12-21 20:40   ` Gaston Gonzalez

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=ae3e8feaf7aa72a85f2e901a31bb382acf8a1ed3.1639858361.git.gascoar@gmail.com \
    --to=gascoar@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=juerg.haefliger@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mitaliborkar810@gmail.com \
    --cc=nsaenz@kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=rdunlap@infradead.org \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=stefan.wahren@i2se.com \
    --cc=unixbhaskar@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).