All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: bcm2835-audio: fix multiple checkpatch issues in bcm2835-vchiq.c
@ 2017-03-03 18:16 Aishwarya Pant
  2017-03-03 18:16 ` [PATCH 1/5] staging: bcm2835-audio: remove spaces after cast Aishwarya Pant
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Aishwarya Pant @ 2017-03-03 18:16 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

Fix multiple code styling warnings issued by checkpatch on file
bcm2835-vchiq.c in bcm2835-audio driver

Aishwarya Pant (5):

  staging-audio: remove spaces after cast
  staging: bcm2835-audio: use braces on all arms of statement
  staging: bcm2835-audio: fix typo in word
  staging: bcm2835-audio: match alignment with open parenthesis
  staging: bcm2835-audio: use min_t() macro instead of min()

 .../vc04_services/bcm2835-audio/bcm2835-vchiq.c    | 34 ++++++++++++----------
 1 file changed, 18 insertions(+), 16 deletions(-)

-- 
2.7.4



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

* [PATCH 1/5] staging: bcm2835-audio: remove spaces after cast
  2017-03-03 18:16 [PATCH 0/5] staging: bcm2835-audio: fix multiple checkpatch issues in bcm2835-vchiq.c Aishwarya Pant
@ 2017-03-03 18:16 ` Aishwarya Pant
  2017-03-03 18:17 ` [PATCH 2/5] staging: bcm2835-audio: use braces on all arms of statement Aishwarya Pant
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Aishwarya Pant @ 2017-03-03 18:16 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

Remove instances of unnecessary blank space after cast in bcm2835-vchiq.c

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index df1f3dd..3cc75b3 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -125,7 +125,7 @@ static void my_wq_function(struct work_struct *work)
 		LOG_ERR(" Unexpected work: %p:%d\n", w->alsa_stream, w->cmd);
 		break;
 	}
-	kfree((void *) work);
+	kfree((void *)work);
 	LOG_DBG(" .. OUT %d\n", ret);
 }
 
@@ -854,7 +854,7 @@ static int bcm2835_audio_write_worker(struct bcm2835_alsa_stream *alsa_stream,
 				NULL);
 		} else {
 			while (count > 0) {
-				int bytes = min((int) m.u.write.max_packet, (int) count);
+				int bytes = min((int)m.u.write.max_packet, (int)count);
 
 				status = bcm2835_vchi_msg_queue(instance->vchi_handle[0],
 								src, bytes);
-- 
2.7.4



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

* [PATCH 2/5] staging: bcm2835-audio: use braces on all arms of statement
  2017-03-03 18:16 [PATCH 0/5] staging: bcm2835-audio: fix multiple checkpatch issues in bcm2835-vchiq.c Aishwarya Pant
  2017-03-03 18:16 ` [PATCH 1/5] staging: bcm2835-audio: remove spaces after cast Aishwarya Pant
@ 2017-03-03 18:17 ` Aishwarya Pant
  2017-03-03 18:17 ` [PATCH 3/5] staging: bcm2835-audio: fix typo in word Aishwarya Pant
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Aishwarya Pant @ 2017-03-03 18:17 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

Add braces on all arms of the if-else statements in bcm2835-vchiq.c to
comply with kernel coding style.

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 3cc75b3..07f7c34 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -145,8 +145,9 @@ int bcm2835_audio_start(struct bcm2835_alsa_stream *alsa_stream)
 			work->cmd = BCM2835_AUDIO_START;
 			if (queue_work(alsa_stream->my_wq, &work->my_work))
 				ret = 0;
-		} else
+		} else {
 			LOG_ERR(" .. Error: NULL work kmalloc\n");
+		}
 	}
 	LOG_DBG(" .. OUT %d\n", ret);
 	return ret;
@@ -168,8 +169,9 @@ int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream)
 			work->cmd = BCM2835_AUDIO_STOP;
 			if (queue_work(alsa_stream->my_wq, &work->my_work))
 				ret = 0;
-		} else
+		} else {
 			LOG_ERR(" .. Error: NULL work kmalloc\n");
+		}
 	}
 	LOG_DBG(" .. OUT %d\n", ret);
 	return ret;
@@ -194,8 +196,9 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
 			work->count = count;
 			if (queue_work(alsa_stream->my_wq, &work->my_work))
 				ret = 0;
-		} else
+		} else {
 			LOG_ERR(" .. Error: NULL work kmalloc\n");
+		}
 	}
 	LOG_DBG(" .. OUT %d\n", ret);
 	return ret;
-- 
2.7.4



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

* [PATCH 3/5] staging: bcm2835-audio: fix typo in word
  2017-03-03 18:16 [PATCH 0/5] staging: bcm2835-audio: fix multiple checkpatch issues in bcm2835-vchiq.c Aishwarya Pant
  2017-03-03 18:16 ` [PATCH 1/5] staging: bcm2835-audio: remove spaces after cast Aishwarya Pant
  2017-03-03 18:17 ` [PATCH 2/5] staging: bcm2835-audio: use braces on all arms of statement Aishwarya Pant
@ 2017-03-03 18:17 ` Aishwarya Pant
  2017-03-03 18:17 ` [PATCH 4/5] staging: bcm2835-audio: match alignment with open parenthesis Aishwarya Pant
  2017-03-03 18:20 ` [PATCH 5/5] staging: bcm2835-audio: use min_t() macro instead of min() Aishwarya Pant
  4 siblings, 0 replies; 6+ messages in thread
From: Aishwarya Pant @ 2017-03-03 18:17 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

fix typo in word receives

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 07f7c34..f55c396 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -309,7 +309,7 @@ vc_vchi_audio_init(VCHI_INSTANCE_T vchi_instance,
 			0, // tx fifo size (unused)
 			audio_vchi_callback, // service callback
 			instance, // service callback parameter
-			1, //TODO: remove VCOS_FALSE,   // unaligned bulk recieves
+			1, //TODO: remove VCOS_FALSE,   // unaligned bulk receives
 			1, //TODO: remove VCOS_FALSE,   // unaligned bulk transmits
 			0 // want crc check on bulk transfers
 		};
-- 
2.7.4



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

* [PATCH 4/5] staging: bcm2835-audio: match alignment with open parenthesis
  2017-03-03 18:16 [PATCH 0/5] staging: bcm2835-audio: fix multiple checkpatch issues in bcm2835-vchiq.c Aishwarya Pant
                   ` (2 preceding siblings ...)
  2017-03-03 18:17 ` [PATCH 3/5] staging: bcm2835-audio: fix typo in word Aishwarya Pant
@ 2017-03-03 18:17 ` Aishwarya Pant
  2017-03-03 18:20 ` [PATCH 5/5] staging: bcm2835-audio: use min_t() macro instead of min() Aishwarya Pant
  4 siblings, 0 replies; 6+ messages in thread
From: Aishwarya Pant @ 2017-03-03 18:17 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

Fix the following checkpatch warning issued on bcm2835-vchiq.c:
CHECK: Alignment should match open parenthesis

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 .../vc04_services/bcm2835-audio/bcm2835-vchiq.c       | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index f55c396..09168e7 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -316,7 +316,8 @@ vc_vchi_audio_init(VCHI_INSTANCE_T vchi_instance,
 
 		LOG_DBG("%s: about to open %i\n", __func__, i);
 		status = vchi_service_open(vchi_instance, &params,
-			&instance->vchi_handle[i]);
+					   &instance->vchi_handle[i]);
+
 		LOG_DBG("%s: opened %i: %p=%d\n", __func__, i, instance->vchi_handle[i], status);
 		if (status) {
 			LOG_ERR("%s: failed to open VCHI service connection (status=%d)\n",
@@ -598,7 +599,7 @@ int bcm2835_audio_set_params(struct bcm2835_alsa_stream *alsa_stream,
 	LOG_DBG(" .. IN\n");
 
 	LOG_INFO(" Setting ALSA channels(%d), samplerate(%d), bits-per-sample(%d)\n",
-		channels, samplerate, bps);
+		 channels, samplerate, bps);
 
 	/* resend ctls - alsa_stream may not have been open when first send */
 	ret = bcm2835_audio_set_ctls_chan(alsa_stream, alsa_stream->chip);
@@ -822,7 +823,7 @@ static int bcm2835_audio_write_worker(struct bcm2835_alsa_stream *alsa_stream,
 	vchi_service_use(instance->vchi_handle[0]);
 
 	if (instance->peer_version == 0 &&
-			vchi_get_peer_version(instance->vchi_handle[0], &instance->peer_version) == 0)
+	    vchi_get_peer_version(instance->vchi_handle[0], &instance->peer_version) == 0)
 		LOG_DBG("%s: client version %d connected\n", __func__, instance->peer_version);
 
 	m.type = VC_AUDIO_MSG_TYPE_WRITE;
@@ -848,13 +849,11 @@ static int bcm2835_audio_write_worker(struct bcm2835_alsa_stream *alsa_stream,
 		if (!m.u.write.max_packet) {
 			/* Send the message to the videocore */
 			status = vchi_bulk_queue_transmit(instance->vchi_handle[0],
-				src, count,
-				0 *
-				VCHI_FLAGS_BLOCK_UNTIL_QUEUED
-				+
-				1 *
-				VCHI_FLAGS_BLOCK_UNTIL_DATA_READ,
-				NULL);
+							  src, count,
+							  0 * VCHI_FLAGS_BLOCK_UNTIL_QUEUED
+							  +
+							  1 * VCHI_FLAGS_BLOCK_UNTIL_DATA_READ,
+							  NULL);
 		} else {
 			while (count > 0) {
 				int bytes = min((int)m.u.write.max_packet, (int)count);
-- 
2.7.4



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

* [PATCH 5/5] staging: bcm2835-audio: use min_t() macro instead of min()
  2017-03-03 18:16 [PATCH 0/5] staging: bcm2835-audio: fix multiple checkpatch issues in bcm2835-vchiq.c Aishwarya Pant
                   ` (3 preceding siblings ...)
  2017-03-03 18:17 ` [PATCH 4/5] staging: bcm2835-audio: match alignment with open parenthesis Aishwarya Pant
@ 2017-03-03 18:20 ` Aishwarya Pant
  4 siblings, 0 replies; 6+ messages in thread
From: Aishwarya Pant @ 2017-03-03 18:20 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

use min_t() macro in place of min() to replace the two typecasts of min.
Change suggested by checkpatch script.

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 09168e7..c54bef3 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -856,7 +856,7 @@ static int bcm2835_audio_write_worker(struct bcm2835_alsa_stream *alsa_stream,
 							  NULL);
 		} else {
 			while (count > 0) {
-				int bytes = min((int)m.u.write.max_packet, (int)count);
+				int bytes = min_t(int, m.u.write.max_packet, count);
 
 				status = bcm2835_vchi_msg_queue(instance->vchi_handle[0],
 								src, bytes);
-- 
2.7.4



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

end of thread, other threads:[~2017-03-03 18:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 18:16 [PATCH 0/5] staging: bcm2835-audio: fix multiple checkpatch issues in bcm2835-vchiq.c Aishwarya Pant
2017-03-03 18:16 ` [PATCH 1/5] staging: bcm2835-audio: remove spaces after cast Aishwarya Pant
2017-03-03 18:17 ` [PATCH 2/5] staging: bcm2835-audio: use braces on all arms of statement Aishwarya Pant
2017-03-03 18:17 ` [PATCH 3/5] staging: bcm2835-audio: fix typo in word Aishwarya Pant
2017-03-03 18:17 ` [PATCH 4/5] staging: bcm2835-audio: match alignment with open parenthesis Aishwarya Pant
2017-03-03 18:20 ` [PATCH 5/5] staging: bcm2835-audio: use min_t() macro instead of min() Aishwarya Pant

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.