[PATCH] staging: bcm2835-audio: Fix various checkpatch warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix following warnings in bcm2835.c:
* Do not initialise statics to NULL.
* Unnecessary whitespace before a quoted newline.
* Open brace { on wrong line.

Fix 'Missing blank line after declarations' by simplifying
bcm2835_alsa_device_init().

Signed-off-by: Simon Sandström <simon@xxxxxxxxxx>
---
 drivers/staging/bcm2835-audio/bcm2835.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835.c b/drivers/staging/bcm2835-audio/bcm2835.c
index a84d74daccbc..8f13eb9e7478 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/bcm2835-audio/bcm2835.c
@@ -28,8 +28,8 @@
  * to debug if we run into issues
  */
 
-static struct snd_card *g_card = NULL;
-static struct bcm2835_chip *g_chip = NULL;
+static struct snd_card *g_card;
+static struct bcm2835_chip *g_chip;
 
 static int snd_bcm2835_free(struct bcm2835_chip *chip)
 {
@@ -50,7 +50,7 @@ static int snd_bcm2835_dev_free(struct snd_device *device)
  */
 static int snd_bcm2835_create(struct snd_card *card,
 	struct platform_device *pdev,
-	struct bcm2835_chip ** rchip)
+	struct bcm2835_chip **rchip)
 {
 	struct bcm2835_chip *chip;
 	int err;
@@ -139,7 +139,7 @@ static int snd_bcm2835_alsa_probe_dt(struct platform_device *pdev)
 
 	err = snd_card_register(card);
 	if (err) {
-		dev_err(dev, "Failed to register bcm2835 ALSA card \n");
+		dev_err(dev, "Failed to register bcm2835 ALSA card\n");
 		goto err_free;
 	}
 
@@ -219,8 +219,7 @@ static struct platform_driver bcm2835_alsa0_driver = {
 	.suspend = snd_bcm2835_alsa_suspend,
 	.resume = snd_bcm2835_alsa_resume,
 #endif
-	.driver =
-	{
+	.driver = {
 		.name = "bcm2835_AUD0",
 		.owner = THIS_MODULE,
 		.of_match_table = snd_bcm2835_of_match_table,
@@ -229,14 +228,13 @@ static struct platform_driver bcm2835_alsa0_driver = {
 
 static int bcm2835_alsa_device_init(void)
 {
-	int err;
-	err = platform_driver_register(&bcm2835_alsa0_driver);
-	if (err) {
-		pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-		return err;
-	}
+	int ret;
 
-	return 0;
+	ret = platform_driver_register(&bcm2835_alsa0_driver);
+	if (ret)
+		pr_err("Error registering bcm2835_alsa0_driver %d .\n", ret);
+
+	return ret;
 }
 
 static void bcm2835_alsa_device_exit(void)
-- 
2.11.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux