linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] staging: vc04_services: Fix small style issues
@ 2017-12-06  0:09 Genki Sky
  2017-12-06  0:09 ` [PATCH v3 2/3] staging: vc04_services: Unsplit user-visible strings Genki Sky
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Genki Sky @ 2017-12-06  0:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This is v3 of a patch series to fix some checkpatch.pl warnings in
drivers/staging/vc04_services/bcm2835-camera/*

Changes from v2 [2]:
- Provide more detailed description in commit messages

Changes from v1 [1]:
- Split single patch into multiple patches
- Remove reference to eudyptula in commit message

[1]: https://lkml.kernel.org/r/30cc7b48def470f1bec8d8d255044f4f220531ee.1512368114.git.sky at genki.is
[2]: https://lkml.kernel.org/r/cover.1512441073.git.sky at genki.is

[ aside: this is for task-10 of http://eudyptula-challenge.org/ ]

Genki Sky (3):
  staging: vc04_services: Join multiline dereferences
  staging: vc04_services: Unsplit user-visible strings
  staging: vc04_services: Use __func__

 .../vc04_services/bcm2835-camera/bcm2835-camera.c  | 23 +++++++++-------------
 .../vc04_services/bcm2835-camera/mmal-vchiq.c      |  7 +++----
 2 files changed, 12 insertions(+), 18 deletions(-)

--
2.15.1

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

* [PATCH v3 2/3] staging: vc04_services: Unsplit user-visible strings
  2017-12-06  0:09 [PATCH v3 0/3] staging: vc04_services: Fix small style issues Genki Sky
@ 2017-12-06  0:09 ` Genki Sky
  2017-12-06  0:09 ` [PATCH v3 1/3] staging: vc04_services: Join multiline dereferences Genki Sky
  2017-12-06  0:09 ` [PATCH v3 3/3] staging: vc04_services: Use __func__ Genki Sky
  2 siblings, 0 replies; 4+ messages in thread
From: Genki Sky @ 2017-12-06  0:09 UTC (permalink / raw)
  To: linux-arm-kernel

This was found using checkpatch.pl's SPLIT_STRING warning. While joining
these strings makes for long lines, the kernel codebase consistently
does it this way to make user-visible strings easier to grep for.

Signed-off-by: Genki Sky <sky@genki.is>
---
 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 7 +++----
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c     | 3 +--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index 4ed3b449f97f..e26895dc052e 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -347,8 +347,7 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
 				timestamp = ktime_add_us(dev->capture.kernel_start_ts,
 							 runtime_us);
 				v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
-					 "Convert start time %llu and %llu "
-					 "with offset %llu to %llu\n",
+					 "Convert start time %llu and %llu with offset %llu to %llu\n",
 					 ktime_to_ns(dev->capture.kernel_start_ts),
 					 dev->capture.vc_start_timestamp, pts,
 					 ktime_to_ns(timestamp));
@@ -532,8 +531,8 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 	    vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb);
 	if (ret) {
 		v4l2_err(&dev->v4l2_dev,
-			"Failed to enable capture port - error %d. "
-			"Disabling camera port again\n", ret);
+			"Failed to enable capture port - error %d. Disabling camera port again\n",
+			ret);
 
 		vchiq_mmal_port_disable(dev->instance,
 					dev->capture.camera_port);
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
index 6ea7fb0ea50e..5ddea4f54bf7 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -1360,8 +1360,7 @@ static int port_action_handle(struct vchiq_mmal_instance *instance,
 
 	ret = -rmsg->u.port_action_reply.status;
 
-	pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d)" \
-		 " connect component:0x%x connect port:%d\n",
+	pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d) connect component:0x%x connect port:%d\n",
 		 __func__,
 		 ret, port->component->handle, port->handle,
 		 port_action_type_names[action_type],
-- 
2.15.1

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

* [PATCH v3 1/3] staging: vc04_services: Join multiline dereferences
  2017-12-06  0:09 [PATCH v3 0/3] staging: vc04_services: Fix small style issues Genki Sky
  2017-12-06  0:09 ` [PATCH v3 2/3] staging: vc04_services: Unsplit user-visible strings Genki Sky
@ 2017-12-06  0:09 ` Genki Sky
  2017-12-06  0:09 ` [PATCH v3 3/3] staging: vc04_services: Use __func__ Genki Sky
  2 siblings, 0 replies; 4+ messages in thread
From: Genki Sky @ 2017-12-06  0:09 UTC (permalink / raw)
  To: linux-arm-kernel

This was found using checkpatch.pl's MULTILINE_DEREFERENCE warning.
Putting the dereference onto one line makes them easier to read,
especially when part of a larger expression (in this case, function
arguments and ternary operator), and when the dereferences are short
(as they are here).

Signed-off-by: Genki Sky <sky@genki.is>
---
 .../vc04_services/bcm2835-camera/bcm2835-camera.c        | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index d8766b166675..4ed3b449f97f 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -328,11 +328,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
 				pr_debug("Grab another frame");
 				vchiq_mmal_port_parameter_set(
 					instance,
-					dev->capture.
-					camera_port,
+					dev->capture.camera_port,
 					MMAL_PARAMETER_CAPTURE,
-					&dev->capture.
-					frame_count,
+					&dev->capture.frame_count,
 					sizeof(dev->capture.frame_count));
 			}
 		} else {
@@ -368,11 +366,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
 					 "Grab another frame as buffer has EOS");
 				vchiq_mmal_port_parameter_set(
 					instance,
-					dev->capture.
-					camera_port,
+					dev->capture.camera_port,
 					MMAL_PARAMETER_CAPTURE,
-					&dev->capture.
-					frame_count,
+					&dev->capture.frame_count,
 					sizeof(dev->capture.frame_count));
 			}
 		} else {
@@ -1194,8 +1190,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
 					port->current_buffer.size =
 					    (f->fmt.pix.sizeimage <
 					     (100 << 10))
-					    ? (100 << 10) : f->fmt.pix.
-					    sizeimage;
+					    ? (100 << 10)
+					    : f->fmt.pix.sizeimage;
 				}
 				v4l2_dbg(1, bcm2835_v4l2_debug,
 					 &dev->v4l2_dev,
-- 
2.15.1

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

* [PATCH v3 3/3] staging: vc04_services: Use __func__
  2017-12-06  0:09 [PATCH v3 0/3] staging: vc04_services: Fix small style issues Genki Sky
  2017-12-06  0:09 ` [PATCH v3 2/3] staging: vc04_services: Unsplit user-visible strings Genki Sky
  2017-12-06  0:09 ` [PATCH v3 1/3] staging: vc04_services: Join multiline dereferences Genki Sky
@ 2017-12-06  0:09 ` Genki Sky
  2 siblings, 0 replies; 4+ messages in thread
From: Genki Sky @ 2017-12-06  0:09 UTC (permalink / raw)
  To: linux-arm-kernel

This was found using checkpatch.pl's EMBEDDED_FUNCTION_NAME warning.
It is easier to be consistent and always use __func__ instead of having
to remember to update any hardcoded references to the original name.

Signed-off-by: Genki Sky <sky@genki.is>
---
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
index 5ddea4f54bf7..6c4d8b4c7cd9 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -618,8 +618,8 @@ static void buffer_to_host_cb(struct vchiq_mmal_instance *instance,
 	struct mmal_msg_context *msg_context;
 	u32 handle;
 
-	pr_debug("buffer_to_host_cb: instance:%p msg:%p msg_len:%d\n",
-		 instance, msg, msg_len);
+	pr_debug("%s: instance:%p msg:%p msg_len:%d\n",
+		 __func__, instance, msg, msg_len);
 
 	if (msg->u.buffer_from_host.drvbuf.magic == MMAL_MAGIC) {
 		handle = msg->u.buffer_from_host.drvbuf.client_context;
-- 
2.15.1

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

end of thread, other threads:[~2017-12-06  0:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-06  0:09 [PATCH v3 0/3] staging: vc04_services: Fix small style issues Genki Sky
2017-12-06  0:09 ` [PATCH v3 2/3] staging: vc04_services: Unsplit user-visible strings Genki Sky
2017-12-06  0:09 ` [PATCH v3 1/3] staging: vc04_services: Join multiline dereferences Genki Sky
2017-12-06  0:09 ` [PATCH v3 3/3] staging: vc04_services: Use __func__ Genki Sky

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).