All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] staging: vc04_services: Promote bool usage
@ 2022-11-18  8:42 ` Umang Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

In commit 7967656ffbfa ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.

Changes in v2:
- Drop ':1' in bool foo:1 usage as mistaken understood as initization
  by me (apologies).


Umang Jain (3):
  Revert "staging: mmal-vchiq: Avoid use of bool in structures"
  vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
  vc04_services: bcm2835-camera: Use bool values for
    mmal_fmt.remove_padding

 .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
 .../vc04_services/vchiq-mmal/mmal-vchiq.c     | 18 +++++------
 .../vc04_services/vchiq-mmal/mmal-vchiq.h     |  6 ++--
 3 files changed, 27 insertions(+), 27 deletions(-)

-- 
2.38.1


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

* [PATCH v2 0/3] staging: vc04_services: Promote bool usage
@ 2022-11-18  8:42 ` Umang Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

In commit 7967656ffbfa ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.

Changes in v2:
- Drop ':1' in bool foo:1 usage as mistaken understood as initization
  by me (apologies).


Umang Jain (3):
  Revert "staging: mmal-vchiq: Avoid use of bool in structures"
  vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
  vc04_services: bcm2835-camera: Use bool values for
    mmal_fmt.remove_padding

 .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
 .../vc04_services/vchiq-mmal/mmal-vchiq.c     | 18 +++++------
 .../vc04_services/vchiq-mmal/mmal-vchiq.h     |  6 ++--
 3 files changed, 27 insertions(+), 27 deletions(-)

-- 
2.38.1


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

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

* [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures"
  2022-11-18  8:42 ` Umang Jain
@ 2022-11-18  8:42   ` Umang Jain
  -1 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca.

In commit 7967656ffbfa ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c    | 12 ++++++------
 .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h    |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index cb921c94996a..4abb6178cb9f 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
 		goto release_msg;
 
 	if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
-		port->enabled = 0;
+		port->enabled = false;
 	else
-		port->enabled = 1;
+		port->enabled = true;
 
 	/* copy the values out of the message */
 	port->handle = rmsg->u.port_info_get_reply.port_handle;
@@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
 	if (!port->enabled)
 		return 0;
 
-	port->enabled = 0;
+	port->enabled = false;
 
 	ret = port_action_port(instance, port,
 			       MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
@@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
 	if (ret)
 		goto done;
 
-	port->enabled = 1;
+	port->enabled = true;
 
 	if (port->buffer_cb) {
 		/* send buffer headers to videocore */
@@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
 			pr_err("failed disconnecting src port\n");
 			goto release_unlock;
 		}
-		src->connected->enabled = 0;
+		src->connected->enabled = false;
 		src->connected = NULL;
 	}
 
@@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
 
 	ret = disable_component(instance, component);
 	if (ret == 0)
-		component->enabled = 0;
+		component->enabled = false;
 
 	mutex_unlock(&instance->vchiq_mutex);
 
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
index 6006e29232b3..6d984cf5a83a 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
@@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
 		int status, struct mmal_buffer *buffer);
 
 struct vchiq_mmal_port {
-	u32 enabled:1;
+	bool enabled;
 	u32 handle;
 	u32 type; /* port type, cached to use on port info set */
 	u32 index; /* port index, cached to use on port info set */
@@ -83,7 +83,7 @@ struct vchiq_mmal_port {
 
 struct vchiq_mmal_component {
 	u32 in_use:1;
-	u32 enabled:1;
+	bool enabled;
 	u32 handle;  /* VideoCore handle for component */
 	u32 inputs;  /* Number of input ports */
 	u32 outputs; /* Number of output ports */
-- 
2.38.1


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

* [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures"
@ 2022-11-18  8:42   ` Umang Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca.

In commit 7967656ffbfa ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c    | 12 ++++++------
 .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h    |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index cb921c94996a..4abb6178cb9f 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
 		goto release_msg;
 
 	if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
-		port->enabled = 0;
+		port->enabled = false;
 	else
-		port->enabled = 1;
+		port->enabled = true;
 
 	/* copy the values out of the message */
 	port->handle = rmsg->u.port_info_get_reply.port_handle;
@@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
 	if (!port->enabled)
 		return 0;
 
-	port->enabled = 0;
+	port->enabled = false;
 
 	ret = port_action_port(instance, port,
 			       MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
@@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
 	if (ret)
 		goto done;
 
-	port->enabled = 1;
+	port->enabled = true;
 
 	if (port->buffer_cb) {
 		/* send buffer headers to videocore */
@@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
 			pr_err("failed disconnecting src port\n");
 			goto release_unlock;
 		}
-		src->connected->enabled = 0;
+		src->connected->enabled = false;
 		src->connected = NULL;
 	}
 
@@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
 
 	ret = disable_component(instance, component);
 	if (ret == 0)
-		component->enabled = 0;
+		component->enabled = false;
 
 	mutex_unlock(&instance->vchiq_mutex);
 
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
index 6006e29232b3..6d984cf5a83a 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
@@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
 		int status, struct mmal_buffer *buffer);
 
 struct vchiq_mmal_port {
-	u32 enabled:1;
+	bool enabled;
 	u32 handle;
 	u32 type; /* port type, cached to use on port info set */
 	u32 index; /* port index, cached to use on port info set */
@@ -83,7 +83,7 @@ struct vchiq_mmal_port {
 
 struct vchiq_mmal_component {
 	u32 in_use:1;
-	u32 enabled:1;
+	bool enabled;
 	u32 handle;  /* VideoCore handle for component */
 	u32 inputs;  /* Number of input ports */
 	u32 outputs; /* Number of output ports */
-- 
2.38.1


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

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

* [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
  2022-11-18  8:42 ` Umang Jain
@ 2022-11-18  8:42   ` Umang Jain
  -1 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

In commit 7967656ffbfa ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++---
 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index 4abb6178cb9f..294b184d4a49 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
 	for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
 		if (!instance->component[idx].in_use) {
 			component = &instance->component[idx];
-			component->in_use = 1;
+			component->in_use = true;
 			break;
 		}
 	}
@@ -1724,7 +1724,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
 	destroy_component(instance, component);
 unlock:
 	if (component)
-		component->in_use = 0;
+		component->in_use = false;
 	mutex_unlock(&instance->vchiq_mutex);
 
 	return ret;
@@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
 
 	ret = destroy_component(instance, component);
 
-	component->in_use = 0;
+	component->in_use = false;
 
 	mutex_unlock(&instance->vchiq_mutex);
 
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
index 6d984cf5a83a..09f030919d4e 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
@@ -82,7 +82,7 @@ struct vchiq_mmal_port {
 };
 
 struct vchiq_mmal_component {
-	u32 in_use:1;
+	bool in_use;
 	bool enabled;
 	u32 handle;  /* VideoCore handle for component */
 	u32 inputs;  /* Number of input ports */
-- 
2.38.1


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

* [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
@ 2022-11-18  8:42   ` Umang Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

In commit 7967656ffbfa ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++---
 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index 4abb6178cb9f..294b184d4a49 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
 	for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
 		if (!instance->component[idx].in_use) {
 			component = &instance->component[idx];
-			component->in_use = 1;
+			component->in_use = true;
 			break;
 		}
 	}
@@ -1724,7 +1724,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
 	destroy_component(instance, component);
 unlock:
 	if (component)
-		component->in_use = 0;
+		component->in_use = false;
 	mutex_unlock(&instance->vchiq_mutex);
 
 	return ret;
@@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
 
 	ret = destroy_component(instance, component);
 
-	component->in_use = 0;
+	component->in_use = false;
 
 	mutex_unlock(&instance->vchiq_mutex);
 
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
index 6d984cf5a83a..09f030919d4e 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
@@ -82,7 +82,7 @@ struct vchiq_mmal_port {
 };
 
 struct vchiq_mmal_component {
-	u32 in_use:1;
+	bool in_use;
 	bool enabled;
 	u32 handle;  /* VideoCore handle for component */
 	u32 inputs;  /* Number of input ports */
-- 
2.38.1


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

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

* [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding
  2022-11-18  8:42 ` Umang Jain
@ 2022-11-18  8:42   ` Umang Jain
  -1 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

mmal_fmt.remove_padding is defined as a boolean type hence, use boolean
values for it instead of 0/1 integers. This enhances code readability.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index fd456d1f7061..797ebe2a973a 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = {
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YUYV,
 		.mmal = MMAL_ENCODING_YUYV,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_RGB24,
 		.mmal = MMAL_ENCODING_RGB24,
 		.depth = 24,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 3,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_JPEG,
 		.flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = {
 		.depth = 8,
 		.mmal_component = COMP_IMAGE_ENCODE,
 		.ybbp = 0,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_H264,
 		.flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = {
 		.depth = 8,
 		.mmal_component = COMP_VIDEO_ENCODE,
 		.ybbp = 0,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_MJPEG,
 		.flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = {
 		.depth = 8,
 		.mmal_component = COMP_VIDEO_ENCODE,
 		.ybbp = 0,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YVYU,
 		.mmal = MMAL_ENCODING_YVYU,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_VYUY,
 		.mmal = MMAL_ENCODING_VYUY,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_UYVY,
 		.mmal = MMAL_ENCODING_UYVY,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_NV12,
 		.mmal = MMAL_ENCODING_NV12,
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_BGR24,
 		.mmal = MMAL_ENCODING_BGR24,
 		.depth = 24,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 3,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YVU420,
 		.mmal = MMAL_ENCODING_YV12,
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_NV21,
 		.mmal = MMAL_ENCODING_NV21,
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_BGR32,
 		.mmal = MMAL_ENCODING_BGRA,
 		.depth = 32,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 4,
-		.remove_padding = 0,
+		.remove_padding = false,
 	},
 };
 
@@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev,
 	struct vchiq_mmal_port *port = NULL, *camera_port = NULL;
 	struct vchiq_mmal_component *encode_component = NULL;
 	struct mmal_fmt *mfmt = get_format(f);
-	u32 remove_padding;
+	bool remove_padding;
 
 	if (!mfmt)
 		return -EINVAL;
-- 
2.38.1


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

* [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding
@ 2022-11-18  8:42   ` Umang Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Umang Jain @ 2022-11-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Dan Carpenter, Greg Kroah-Hartman, Hans Verkuil, Dave Stevenson,
	Mauro Carvalho Chehab, linux-rpi-kernel, linux-arm-kernel,
	linux-staging, linux-kernel
  Cc: kieran.bingham, Umang Jain

mmal_fmt.remove_padding is defined as a boolean type hence, use boolean
values for it instead of 0/1 integers. This enhances code readability.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index fd456d1f7061..797ebe2a973a 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = {
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YUYV,
 		.mmal = MMAL_ENCODING_YUYV,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_RGB24,
 		.mmal = MMAL_ENCODING_RGB24,
 		.depth = 24,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 3,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_JPEG,
 		.flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = {
 		.depth = 8,
 		.mmal_component = COMP_IMAGE_ENCODE,
 		.ybbp = 0,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_H264,
 		.flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = {
 		.depth = 8,
 		.mmal_component = COMP_VIDEO_ENCODE,
 		.ybbp = 0,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_MJPEG,
 		.flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = {
 		.depth = 8,
 		.mmal_component = COMP_VIDEO_ENCODE,
 		.ybbp = 0,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YVYU,
 		.mmal = MMAL_ENCODING_YVYU,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_VYUY,
 		.mmal = MMAL_ENCODING_VYUY,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_UYVY,
 		.mmal = MMAL_ENCODING_UYVY,
 		.depth = 16,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 2,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_NV12,
 		.mmal = MMAL_ENCODING_NV12,
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_BGR24,
 		.mmal = MMAL_ENCODING_BGR24,
 		.depth = 24,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 3,
-		.remove_padding = 0,
+		.remove_padding = false,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YVU420,
 		.mmal = MMAL_ENCODING_YV12,
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_NV21,
 		.mmal = MMAL_ENCODING_NV21,
 		.depth = 12,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 1,
-		.remove_padding = 1,
+		.remove_padding = true,
 	}, {
 		.fourcc = V4L2_PIX_FMT_BGR32,
 		.mmal = MMAL_ENCODING_BGRA,
 		.depth = 32,
 		.mmal_component = COMP_CAMERA,
 		.ybbp = 4,
-		.remove_padding = 0,
+		.remove_padding = false,
 	},
 };
 
@@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev,
 	struct vchiq_mmal_port *port = NULL, *camera_port = NULL;
 	struct vchiq_mmal_component *encode_component = NULL;
 	struct mmal_fmt *mfmt = get_format(f);
-	u32 remove_padding;
+	bool remove_padding;
 
 	if (!mfmt)
 		return -EINVAL;
-- 
2.38.1


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

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

* Re: [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures"
  2022-11-18  8:42   ` Umang Jain
@ 2022-11-18 10:21     ` Kieran Bingham
  -1 siblings, 0 replies; 20+ messages in thread
From: Kieran Bingham @ 2022-11-18 10:21 UTC (permalink / raw)
  To: Broadcom internal kernel review list, Dan Carpenter,
	Dave Stevenson, Florian Fainelli, Greg Kroah-Hartman,
	Hans Verkuil, Mauro Carvalho Chehab, Ray Jui, Umang Jain,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-staging
  Cc: Umang Jain

Quoting Umang Jain (2022-11-18 08:42:42)
> This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca.
> 
> In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> bool") the check to dis-allow bool structure members was removed from
> checkpatch.pl. It promotes bool structure members to store boolean
> values. This enhances code readability.
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>

Thanks,

That's a more direct revert of 640e77466e69 ("staging: mmal-vchiq: Avoid
use of bool in structures") indeed.

I see Stefan was concerned about clarifying that this won't affect
firmware or userspace, it may still be good to hear from Dave to
confirm, but my understanding of 640e77466e69, means I believe this is
safe. I don't expect this structure to be used as any kind of ABI to
firmware or userspace.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


> ---
>  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c    | 12 ++++++------
>  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h    |  4 ++--
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> index cb921c94996a..4abb6178cb9f 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> @@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
>                 goto release_msg;
>  
>         if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
> -               port->enabled = 0;
> +               port->enabled = false;
>         else
> -               port->enabled = 1;
> +               port->enabled = true;
>  
>         /* copy the values out of the message */
>         port->handle = rmsg->u.port_info_get_reply.port_handle;
> @@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
>         if (!port->enabled)
>                 return 0;
>  
> -       port->enabled = 0;
> +       port->enabled = false;
>  
>         ret = port_action_port(instance, port,
>                                MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
> @@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
>         if (ret)
>                 goto done;
>  
> -       port->enabled = 1;
> +       port->enabled = true;
>  
>         if (port->buffer_cb) {
>                 /* send buffer headers to videocore */
> @@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
>                         pr_err("failed disconnecting src port\n");
>                         goto release_unlock;
>                 }
> -               src->connected->enabled = 0;
> +               src->connected->enabled = false;
>                 src->connected = NULL;
>         }
>  
> @@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
>  
>         ret = disable_component(instance, component);
>         if (ret == 0)
> -               component->enabled = 0;
> +               component->enabled = false;
>  
>         mutex_unlock(&instance->vchiq_mutex);
>  
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> index 6006e29232b3..6d984cf5a83a 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> @@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
>                 int status, struct mmal_buffer *buffer);
>  
>  struct vchiq_mmal_port {
> -       u32 enabled:1;
> +       bool enabled;
>         u32 handle;
>         u32 type; /* port type, cached to use on port info set */
>         u32 index; /* port index, cached to use on port info set */
> @@ -83,7 +83,7 @@ struct vchiq_mmal_port {
>  
>  struct vchiq_mmal_component {
>         u32 in_use:1;
> -       u32 enabled:1;
> +       bool enabled;
>         u32 handle;  /* VideoCore handle for component */
>         u32 inputs;  /* Number of input ports */
>         u32 outputs; /* Number of output ports */
> -- 
> 2.38.1
>

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

* Re: [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures"
@ 2022-11-18 10:21     ` Kieran Bingham
  0 siblings, 0 replies; 20+ messages in thread
From: Kieran Bingham @ 2022-11-18 10:21 UTC (permalink / raw)
  To: Broadcom internal kernel review list, Dan Carpenter,
	Dave Stevenson, Florian Fainelli, Greg Kroah-Hartman,
	Hans Verkuil, Mauro Carvalho Chehab, Ray Jui, Umang Jain,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-staging
  Cc: Umang Jain

Quoting Umang Jain (2022-11-18 08:42:42)
> This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca.
> 
> In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> bool") the check to dis-allow bool structure members was removed from
> checkpatch.pl. It promotes bool structure members to store boolean
> values. This enhances code readability.
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>

Thanks,

That's a more direct revert of 640e77466e69 ("staging: mmal-vchiq: Avoid
use of bool in structures") indeed.

I see Stefan was concerned about clarifying that this won't affect
firmware or userspace, it may still be good to hear from Dave to
confirm, but my understanding of 640e77466e69, means I believe this is
safe. I don't expect this structure to be used as any kind of ABI to
firmware or userspace.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


> ---
>  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c    | 12 ++++++------
>  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h    |  4 ++--
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> index cb921c94996a..4abb6178cb9f 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> @@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
>                 goto release_msg;
>  
>         if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
> -               port->enabled = 0;
> +               port->enabled = false;
>         else
> -               port->enabled = 1;
> +               port->enabled = true;
>  
>         /* copy the values out of the message */
>         port->handle = rmsg->u.port_info_get_reply.port_handle;
> @@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
>         if (!port->enabled)
>                 return 0;
>  
> -       port->enabled = 0;
> +       port->enabled = false;
>  
>         ret = port_action_port(instance, port,
>                                MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
> @@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
>         if (ret)
>                 goto done;
>  
> -       port->enabled = 1;
> +       port->enabled = true;
>  
>         if (port->buffer_cb) {
>                 /* send buffer headers to videocore */
> @@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
>                         pr_err("failed disconnecting src port\n");
>                         goto release_unlock;
>                 }
> -               src->connected->enabled = 0;
> +               src->connected->enabled = false;
>                 src->connected = NULL;
>         }
>  
> @@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
>  
>         ret = disable_component(instance, component);
>         if (ret == 0)
> -               component->enabled = 0;
> +               component->enabled = false;
>  
>         mutex_unlock(&instance->vchiq_mutex);
>  
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> index 6006e29232b3..6d984cf5a83a 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> @@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
>                 int status, struct mmal_buffer *buffer);
>  
>  struct vchiq_mmal_port {
> -       u32 enabled:1;
> +       bool enabled;
>         u32 handle;
>         u32 type; /* port type, cached to use on port info set */
>         u32 index; /* port index, cached to use on port info set */
> @@ -83,7 +83,7 @@ struct vchiq_mmal_port {
>  
>  struct vchiq_mmal_component {
>         u32 in_use:1;
> -       u32 enabled:1;
> +       bool enabled;
>         u32 handle;  /* VideoCore handle for component */
>         u32 inputs;  /* Number of input ports */
>         u32 outputs; /* Number of output ports */
> -- 
> 2.38.1
>

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

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

* Re: [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
  2022-11-18  8:42   ` Umang Jain
@ 2022-11-18 10:30     ` Kieran Bingham
  -1 siblings, 0 replies; 20+ messages in thread
From: Kieran Bingham @ 2022-11-18 10:30 UTC (permalink / raw)
  To: Broadcom internal kernel review list, Dan Carpenter,
	Dave Stevenson, Florian Fainelli, Greg Kroah-Hartman,
	Hans Verkuil, Mauro Carvalho Chehab, Ray Jui, Umang Jain,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-staging
  Cc: Umang Jain

Quoting Umang Jain (2022-11-18 08:42:43)
> In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> bool") the check to dis-allow bool structure members was removed from
> checkpatch.pl. It promotes bool structure members to store boolean
> values. This enhances code readability.

This only talks about 7967656ffbfa as I can interpret it.  A sentence
here describing what we're going to do about it in /this/ patch would be
clearer as a second paragraph:

"""
Convert the remaining bit-field storage for 'in-use' to a bool and use
it accordingly.
"""

But that's trivial and not worth a v3 specifically. (unless anyone
applying this wants to add it).

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++---
>  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> index 4abb6178cb9f..294b184d4a49 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> @@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
>         for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
>                 if (!instance->component[idx].in_use) {
>                         component = &instance->component[idx];
> -                       component->in_use = 1;
> +                       component->in_use = true;
>                         break;
>                 }
>         }
> @@ -1724,7 +1724,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
>         destroy_component(instance, component);
>  unlock:
>         if (component)
> -               component->in_use = 0;
> +               component->in_use = false;
>         mutex_unlock(&instance->vchiq_mutex);
>  
>         return ret;
> @@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
>  
>         ret = destroy_component(instance, component);
>  
> -       component->in_use = 0;
> +       component->in_use = false;
>  
>         mutex_unlock(&instance->vchiq_mutex);
>  
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> index 6d984cf5a83a..09f030919d4e 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> @@ -82,7 +82,7 @@ struct vchiq_mmal_port {
>  };
>  
>  struct vchiq_mmal_component {
> -       u32 in_use:1;
> +       bool in_use;
>         bool enabled;
>         u32 handle;  /* VideoCore handle for component */
>         u32 inputs;  /* Number of input ports */
> -- 
> 2.38.1
>

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

* Re: [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
@ 2022-11-18 10:30     ` Kieran Bingham
  0 siblings, 0 replies; 20+ messages in thread
From: Kieran Bingham @ 2022-11-18 10:30 UTC (permalink / raw)
  To: Broadcom internal kernel review list, Dan Carpenter,
	Dave Stevenson, Florian Fainelli, Greg Kroah-Hartman,
	Hans Verkuil, Mauro Carvalho Chehab, Ray Jui, Umang Jain,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-staging
  Cc: Umang Jain

Quoting Umang Jain (2022-11-18 08:42:43)
> In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> bool") the check to dis-allow bool structure members was removed from
> checkpatch.pl. It promotes bool structure members to store boolean
> values. This enhances code readability.

This only talks about 7967656ffbfa as I can interpret it.  A sentence
here describing what we're going to do about it in /this/ patch would be
clearer as a second paragraph:

"""
Convert the remaining bit-field storage for 'in-use' to a bool and use
it accordingly.
"""

But that's trivial and not worth a v3 specifically. (unless anyone
applying this wants to add it).

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++---
>  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> index 4abb6178cb9f..294b184d4a49 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> @@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
>         for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
>                 if (!instance->component[idx].in_use) {
>                         component = &instance->component[idx];
> -                       component->in_use = 1;
> +                       component->in_use = true;
>                         break;
>                 }
>         }
> @@ -1724,7 +1724,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
>         destroy_component(instance, component);
>  unlock:
>         if (component)
> -               component->in_use = 0;
> +               component->in_use = false;
>         mutex_unlock(&instance->vchiq_mutex);
>  
>         return ret;
> @@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
>  
>         ret = destroy_component(instance, component);
>  
> -       component->in_use = 0;
> +       component->in_use = false;
>  
>         mutex_unlock(&instance->vchiq_mutex);
>  
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> index 6d984cf5a83a..09f030919d4e 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> @@ -82,7 +82,7 @@ struct vchiq_mmal_port {
>  };
>  
>  struct vchiq_mmal_component {
> -       u32 in_use:1;
> +       bool in_use;
>         bool enabled;
>         u32 handle;  /* VideoCore handle for component */
>         u32 inputs;  /* Number of input ports */
> -- 
> 2.38.1
>

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

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

* Re: [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding
  2022-11-18  8:42   ` Umang Jain
@ 2022-11-18 10:50     ` Kieran Bingham
  -1 siblings, 0 replies; 20+ messages in thread
From: Kieran Bingham @ 2022-11-18 10:50 UTC (permalink / raw)
  To: Broadcom internal kernel review list, Dan Carpenter,
	Dave Stevenson, Florian Fainelli, Greg Kroah-Hartman,
	Hans Verkuil, Mauro Carvalho Chehab, Ray Jui, Umang Jain,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-staging
  Cc: Umang Jain

Quoting Umang Jain (2022-11-18 08:42:44)
> mmal_fmt.remove_padding is defined as a boolean type hence, use boolean
> values for it instead of 0/1 integers. This enhances code readability.

This could be (optionally) expanded:

"""
The field 'remove_padding' in 'struct mmal_fmt' is defined as a boolean
type.

The initialisation of the formats[] array stores integer 0/1 values into
this field rather than a more readable bool type.

Convert the usages to boolean true/false, and fix up the local storage
type in mmal_setup_components() to enhance code readability.
"""

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index fd456d1f7061..797ebe2a973a 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = {
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YUYV,
>                 .mmal = MMAL_ENCODING_YUYV,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_RGB24,
>                 .mmal = MMAL_ENCODING_RGB24,
>                 .depth = 24,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 3,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_JPEG,
>                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> @@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = {
>                 .depth = 8,
>                 .mmal_component = COMP_IMAGE_ENCODE,
>                 .ybbp = 0,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_H264,
>                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> @@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = {
>                 .depth = 8,
>                 .mmal_component = COMP_VIDEO_ENCODE,
>                 .ybbp = 0,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_MJPEG,
>                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> @@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = {
>                 .depth = 8,
>                 .mmal_component = COMP_VIDEO_ENCODE,
>                 .ybbp = 0,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YVYU,
>                 .mmal = MMAL_ENCODING_YVYU,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_VYUY,
>                 .mmal = MMAL_ENCODING_VYUY,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_UYVY,
>                 .mmal = MMAL_ENCODING_UYVY,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_NV12,
>                 .mmal = MMAL_ENCODING_NV12,
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_BGR24,
>                 .mmal = MMAL_ENCODING_BGR24,
>                 .depth = 24,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 3,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YVU420,
>                 .mmal = MMAL_ENCODING_YV12,
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_NV21,
>                 .mmal = MMAL_ENCODING_NV21,
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_BGR32,
>                 .mmal = MMAL_ENCODING_BGRA,
>                 .depth = 32,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 4,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         },
>  };
>  
> @@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev,
>         struct vchiq_mmal_port *port = NULL, *camera_port = NULL;
>         struct vchiq_mmal_component *encode_component = NULL;
>         struct mmal_fmt *mfmt = get_format(f);
> -       u32 remove_padding;
> +       bool remove_padding;
>  
>         if (!mfmt)
>                 return -EINVAL;
> -- 
> 2.38.1
>

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

* Re: [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding
@ 2022-11-18 10:50     ` Kieran Bingham
  0 siblings, 0 replies; 20+ messages in thread
From: Kieran Bingham @ 2022-11-18 10:50 UTC (permalink / raw)
  To: Broadcom internal kernel review list, Dan Carpenter,
	Dave Stevenson, Florian Fainelli, Greg Kroah-Hartman,
	Hans Verkuil, Mauro Carvalho Chehab, Ray Jui, Umang Jain,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-staging
  Cc: Umang Jain

Quoting Umang Jain (2022-11-18 08:42:44)
> mmal_fmt.remove_padding is defined as a boolean type hence, use boolean
> values for it instead of 0/1 integers. This enhances code readability.

This could be (optionally) expanded:

"""
The field 'remove_padding' in 'struct mmal_fmt' is defined as a boolean
type.

The initialisation of the formats[] array stores integer 0/1 values into
this field rather than a more readable bool type.

Convert the usages to boolean true/false, and fix up the local storage
type in mmal_setup_components() to enhance code readability.
"""

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index fd456d1f7061..797ebe2a973a 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = {
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YUYV,
>                 .mmal = MMAL_ENCODING_YUYV,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_RGB24,
>                 .mmal = MMAL_ENCODING_RGB24,
>                 .depth = 24,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 3,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_JPEG,
>                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> @@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = {
>                 .depth = 8,
>                 .mmal_component = COMP_IMAGE_ENCODE,
>                 .ybbp = 0,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_H264,
>                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> @@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = {
>                 .depth = 8,
>                 .mmal_component = COMP_VIDEO_ENCODE,
>                 .ybbp = 0,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_MJPEG,
>                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> @@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = {
>                 .depth = 8,
>                 .mmal_component = COMP_VIDEO_ENCODE,
>                 .ybbp = 0,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YVYU,
>                 .mmal = MMAL_ENCODING_YVYU,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_VYUY,
>                 .mmal = MMAL_ENCODING_VYUY,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_UYVY,
>                 .mmal = MMAL_ENCODING_UYVY,
>                 .depth = 16,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 2,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_NV12,
>                 .mmal = MMAL_ENCODING_NV12,
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_BGR24,
>                 .mmal = MMAL_ENCODING_BGR24,
>                 .depth = 24,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 3,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YVU420,
>                 .mmal = MMAL_ENCODING_YV12,
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_NV21,
>                 .mmal = MMAL_ENCODING_NV21,
>                 .depth = 12,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 1,
> -               .remove_padding = 1,
> +               .remove_padding = true,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_BGR32,
>                 .mmal = MMAL_ENCODING_BGRA,
>                 .depth = 32,
>                 .mmal_component = COMP_CAMERA,
>                 .ybbp = 4,
> -               .remove_padding = 0,
> +               .remove_padding = false,
>         },
>  };
>  
> @@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev,
>         struct vchiq_mmal_port *port = NULL, *camera_port = NULL;
>         struct vchiq_mmal_component *encode_component = NULL;
>         struct mmal_fmt *mfmt = get_format(f);
> -       u32 remove_padding;
> +       bool remove_padding;
>  
>         if (!mfmt)
>                 return -EINVAL;
> -- 
> 2.38.1
>

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

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

* Re: [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures"
  2022-11-18 10:21     ` Kieran Bingham
@ 2022-11-18 17:20       ` Dave Stevenson
  -1 siblings, 0 replies; 20+ messages in thread
From: Dave Stevenson @ 2022-11-18 17:20 UTC (permalink / raw)
  To: Kieran Bingham
  Cc: Broadcom internal kernel review list, Dan Carpenter,
	Florian Fainelli, Greg Kroah-Hartman, Hans Verkuil,
	Mauro Carvalho Chehab, Ray Jui, Umang Jain, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-staging

Hi Umang & Kieran

On Fri, 18 Nov 2022 at 10:21, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Umang Jain (2022-11-18 08:42:42)
> > This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca.
> >
> > In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> > bool") the check to dis-allow bool structure members was removed from
> > checkpatch.pl. It promotes bool structure members to store boolean
> > values. This enhances code readability.
> >
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>
> Thanks,
>
> That's a more direct revert of 640e77466e69 ("staging: mmal-vchiq: Avoid
> use of bool in structures") indeed.
>
> I see Stefan was concerned about clarifying that this won't affect
> firmware or userspace, it may still be good to hear from Dave to
> confirm, but my understanding of 640e77466e69, means I believe this is
> safe. I don't expect this structure to be used as any kind of ABI to
> firmware or userspace.

If it were one of the structs in one of the mmal-msh*.h files, then
I'd worry about the firmware ABI. This is internal state solely on the
kernel side so it's fine.

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

>
> > ---
> >  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c    | 12 ++++++------
> >  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h    |  4 ++--
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > index cb921c94996a..4abb6178cb9f 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > @@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
> >                 goto release_msg;
> >
> >         if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
> > -               port->enabled = 0;
> > +               port->enabled = false;
> >         else
> > -               port->enabled = 1;
> > +               port->enabled = true;
> >
> >         /* copy the values out of the message */
> >         port->handle = rmsg->u.port_info_get_reply.port_handle;
> > @@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
> >         if (!port->enabled)
> >                 return 0;
> >
> > -       port->enabled = 0;
> > +       port->enabled = false;
> >
> >         ret = port_action_port(instance, port,
> >                                MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
> > @@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
> >         if (ret)
> >                 goto done;
> >
> > -       port->enabled = 1;
> > +       port->enabled = true;
> >
> >         if (port->buffer_cb) {
> >                 /* send buffer headers to videocore */
> > @@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
> >                         pr_err("failed disconnecting src port\n");
> >                         goto release_unlock;
> >                 }
> > -               src->connected->enabled = 0;
> > +               src->connected->enabled = false;
> >                 src->connected = NULL;
> >         }
> >
> > @@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
> >
> >         ret = disable_component(instance, component);
> >         if (ret == 0)
> > -               component->enabled = 0;
> > +               component->enabled = false;
> >
> >         mutex_unlock(&instance->vchiq_mutex);
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > index 6006e29232b3..6d984cf5a83a 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > @@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
> >                 int status, struct mmal_buffer *buffer);
> >
> >  struct vchiq_mmal_port {
> > -       u32 enabled:1;
> > +       bool enabled;
> >         u32 handle;
> >         u32 type; /* port type, cached to use on port info set */
> >         u32 index; /* port index, cached to use on port info set */
> > @@ -83,7 +83,7 @@ struct vchiq_mmal_port {
> >
> >  struct vchiq_mmal_component {
> >         u32 in_use:1;
> > -       u32 enabled:1;
> > +       bool enabled;
> >         u32 handle;  /* VideoCore handle for component */
> >         u32 inputs;  /* Number of input ports */
> >         u32 outputs; /* Number of output ports */
> > --
> > 2.38.1
> >

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

* Re: [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures"
@ 2022-11-18 17:20       ` Dave Stevenson
  0 siblings, 0 replies; 20+ messages in thread
From: Dave Stevenson @ 2022-11-18 17:20 UTC (permalink / raw)
  To: Kieran Bingham
  Cc: Broadcom internal kernel review list, Dan Carpenter,
	Florian Fainelli, Greg Kroah-Hartman, Hans Verkuil,
	Mauro Carvalho Chehab, Ray Jui, Umang Jain, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-staging

Hi Umang & Kieran

On Fri, 18 Nov 2022 at 10:21, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Umang Jain (2022-11-18 08:42:42)
> > This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca.
> >
> > In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> > bool") the check to dis-allow bool structure members was removed from
> > checkpatch.pl. It promotes bool structure members to store boolean
> > values. This enhances code readability.
> >
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>
> Thanks,
>
> That's a more direct revert of 640e77466e69 ("staging: mmal-vchiq: Avoid
> use of bool in structures") indeed.
>
> I see Stefan was concerned about clarifying that this won't affect
> firmware or userspace, it may still be good to hear from Dave to
> confirm, but my understanding of 640e77466e69, means I believe this is
> safe. I don't expect this structure to be used as any kind of ABI to
> firmware or userspace.

If it were one of the structs in one of the mmal-msh*.h files, then
I'd worry about the firmware ABI. This is internal state solely on the
kernel side so it's fine.

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

>
> > ---
> >  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c    | 12 ++++++------
> >  .../staging/vc04_services/vchiq-mmal/mmal-vchiq.h    |  4 ++--
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > index cb921c94996a..4abb6178cb9f 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > @@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
> >                 goto release_msg;
> >
> >         if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
> > -               port->enabled = 0;
> > +               port->enabled = false;
> >         else
> > -               port->enabled = 1;
> > +               port->enabled = true;
> >
> >         /* copy the values out of the message */
> >         port->handle = rmsg->u.port_info_get_reply.port_handle;
> > @@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
> >         if (!port->enabled)
> >                 return 0;
> >
> > -       port->enabled = 0;
> > +       port->enabled = false;
> >
> >         ret = port_action_port(instance, port,
> >                                MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
> > @@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
> >         if (ret)
> >                 goto done;
> >
> > -       port->enabled = 1;
> > +       port->enabled = true;
> >
> >         if (port->buffer_cb) {
> >                 /* send buffer headers to videocore */
> > @@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
> >                         pr_err("failed disconnecting src port\n");
> >                         goto release_unlock;
> >                 }
> > -               src->connected->enabled = 0;
> > +               src->connected->enabled = false;
> >                 src->connected = NULL;
> >         }
> >
> > @@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
> >
> >         ret = disable_component(instance, component);
> >         if (ret == 0)
> > -               component->enabled = 0;
> > +               component->enabled = false;
> >
> >         mutex_unlock(&instance->vchiq_mutex);
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > index 6006e29232b3..6d984cf5a83a 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > @@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
> >                 int status, struct mmal_buffer *buffer);
> >
> >  struct vchiq_mmal_port {
> > -       u32 enabled:1;
> > +       bool enabled;
> >         u32 handle;
> >         u32 type; /* port type, cached to use on port info set */
> >         u32 index; /* port index, cached to use on port info set */
> > @@ -83,7 +83,7 @@ struct vchiq_mmal_port {
> >
> >  struct vchiq_mmal_component {
> >         u32 in_use:1;
> > -       u32 enabled:1;
> > +       bool enabled;
> >         u32 handle;  /* VideoCore handle for component */
> >         u32 inputs;  /* Number of input ports */
> >         u32 outputs; /* Number of output ports */
> > --
> > 2.38.1
> >

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

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

* Re: [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
  2022-11-18 10:30     ` Kieran Bingham
@ 2022-11-18 17:22       ` Dave Stevenson
  -1 siblings, 0 replies; 20+ messages in thread
From: Dave Stevenson @ 2022-11-18 17:22 UTC (permalink / raw)
  To: Kieran Bingham
  Cc: Broadcom internal kernel review list, Dan Carpenter,
	Florian Fainelli, Greg Kroah-Hartman, Hans Verkuil,
	Mauro Carvalho Chehab, Ray Jui, Umang Jain, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-staging

Hi Umang & Kieran

On Fri, 18 Nov 2022 at 10:30, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Umang Jain (2022-11-18 08:42:43)
> > In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> > bool") the check to dis-allow bool structure members was removed from
> > checkpatch.pl. It promotes bool structure members to store boolean
> > values. This enhances code readability.
>
> This only talks about 7967656ffbfa as I can interpret it.  A sentence
> here describing what we're going to do about it in /this/ patch would be
> clearer as a second paragraph:
>
> """
> Convert the remaining bit-field storage for 'in-use' to a bool and use
> it accordingly.
> """
>
> But that's trivial and not worth a v3 specifically. (unless anyone
> applying this wants to add it).

Totally agree.

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

> >
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> > ---
> >  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++---
> >  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +-
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > index 4abb6178cb9f..294b184d4a49 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > @@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
> >         for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
> >                 if (!instance->component[idx].in_use) {
> >                         component = &instance->component[idx];
> > -                       component->in_use = 1;
> > +                       component->in_use = true;
> >                         break;
> >                 }
> >         }
> > @@ -1724,7 +1724,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
> >         destroy_component(instance, component);
> >  unlock:
> >         if (component)
> > -               component->in_use = 0;
> > +               component->in_use = false;
> >         mutex_unlock(&instance->vchiq_mutex);
> >
> >         return ret;
> > @@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
> >
> >         ret = destroy_component(instance, component);
> >
> > -       component->in_use = 0;
> > +       component->in_use = false;
> >
> >         mutex_unlock(&instance->vchiq_mutex);
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > index 6d984cf5a83a..09f030919d4e 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > @@ -82,7 +82,7 @@ struct vchiq_mmal_port {
> >  };
> >
> >  struct vchiq_mmal_component {
> > -       u32 in_use:1;
> > +       bool in_use;
> >         bool enabled;
> >         u32 handle;  /* VideoCore handle for component */
> >         u32 inputs;  /* Number of input ports */
> > --
> > 2.38.1
> >

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

* Re: [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
@ 2022-11-18 17:22       ` Dave Stevenson
  0 siblings, 0 replies; 20+ messages in thread
From: Dave Stevenson @ 2022-11-18 17:22 UTC (permalink / raw)
  To: Kieran Bingham
  Cc: Broadcom internal kernel review list, Dan Carpenter,
	Florian Fainelli, Greg Kroah-Hartman, Hans Verkuil,
	Mauro Carvalho Chehab, Ray Jui, Umang Jain, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-staging

Hi Umang & Kieran

On Fri, 18 Nov 2022 at 10:30, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Umang Jain (2022-11-18 08:42:43)
> > In commit 7967656ffbfa ("coding-style: Clarify the expectations around
> > bool") the check to dis-allow bool structure members was removed from
> > checkpatch.pl. It promotes bool structure members to store boolean
> > values. This enhances code readability.
>
> This only talks about 7967656ffbfa as I can interpret it.  A sentence
> here describing what we're going to do about it in /this/ patch would be
> clearer as a second paragraph:
>
> """
> Convert the remaining bit-field storage for 'in-use' to a bool and use
> it accordingly.
> """
>
> But that's trivial and not worth a v3 specifically. (unless anyone
> applying this wants to add it).

Totally agree.

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

> >
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> > ---
> >  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 6 +++---
> >  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h | 2 +-
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > index 4abb6178cb9f..294b184d4a49 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> > @@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
> >         for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
> >                 if (!instance->component[idx].in_use) {
> >                         component = &instance->component[idx];
> > -                       component->in_use = 1;
> > +                       component->in_use = true;
> >                         break;
> >                 }
> >         }
> > @@ -1724,7 +1724,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
> >         destroy_component(instance, component);
> >  unlock:
> >         if (component)
> > -               component->in_use = 0;
> > +               component->in_use = false;
> >         mutex_unlock(&instance->vchiq_mutex);
> >
> >         return ret;
> > @@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
> >
> >         ret = destroy_component(instance, component);
> >
> > -       component->in_use = 0;
> > +       component->in_use = false;
> >
> >         mutex_unlock(&instance->vchiq_mutex);
> >
> > diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > index 6d984cf5a83a..09f030919d4e 100644
> > --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
> > @@ -82,7 +82,7 @@ struct vchiq_mmal_port {
> >  };
> >
> >  struct vchiq_mmal_component {
> > -       u32 in_use:1;
> > +       bool in_use;
> >         bool enabled;
> >         u32 handle;  /* VideoCore handle for component */
> >         u32 inputs;  /* Number of input ports */
> > --
> > 2.38.1
> >

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

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

* Re: [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding
  2022-11-18 10:50     ` Kieran Bingham
@ 2022-11-18 17:23       ` Dave Stevenson
  -1 siblings, 0 replies; 20+ messages in thread
From: Dave Stevenson @ 2022-11-18 17:23 UTC (permalink / raw)
  To: Kieran Bingham
  Cc: Broadcom internal kernel review list, Dan Carpenter,
	Florian Fainelli, Greg Kroah-Hartman, Hans Verkuil,
	Mauro Carvalho Chehab, Ray Jui, Umang Jain, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-staging

On Fri, 18 Nov 2022 at 10:50, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Umang Jain (2022-11-18 08:42:44)
> > mmal_fmt.remove_padding is defined as a boolean type hence, use boolean
> > values for it instead of 0/1 integers. This enhances code readability.
>
> This could be (optionally) expanded:
>
> """
> The field 'remove_padding' in 'struct mmal_fmt' is defined as a boolean
> type.
>
> The initialisation of the formats[] array stores integer 0/1 values into
> this field rather than a more readable bool type.
>
> Convert the usages to boolean true/false, and fix up the local storage
> type in mmal_setup_components() to enhance code readability.
> """

Again I'll agree.

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

>
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> > ---
> >  .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
> >  1 file changed, 15 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> > index fd456d1f7061..797ebe2a973a 100644
> > --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> > +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> > @@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_YUYV,
> >                 .mmal = MMAL_ENCODING_YUYV,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_RGB24,
> >                 .mmal = MMAL_ENCODING_RGB24,
> >                 .depth = 24,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 3,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_JPEG,
> >                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> > @@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 8,
> >                 .mmal_component = COMP_IMAGE_ENCODE,
> >                 .ybbp = 0,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_H264,
> >                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> > @@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 8,
> >                 .mmal_component = COMP_VIDEO_ENCODE,
> >                 .ybbp = 0,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_MJPEG,
> >                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> > @@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 8,
> >                 .mmal_component = COMP_VIDEO_ENCODE,
> >                 .ybbp = 0,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_YVYU,
> >                 .mmal = MMAL_ENCODING_YVYU,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_VYUY,
> >                 .mmal = MMAL_ENCODING_VYUY,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_UYVY,
> >                 .mmal = MMAL_ENCODING_UYVY,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_NV12,
> >                 .mmal = MMAL_ENCODING_NV12,
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_BGR24,
> >                 .mmal = MMAL_ENCODING_BGR24,
> >                 .depth = 24,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 3,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_YVU420,
> >                 .mmal = MMAL_ENCODING_YV12,
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_NV21,
> >                 .mmal = MMAL_ENCODING_NV21,
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_BGR32,
> >                 .mmal = MMAL_ENCODING_BGRA,
> >                 .depth = 32,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 4,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         },
> >  };
> >
> > @@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev,
> >         struct vchiq_mmal_port *port = NULL, *camera_port = NULL;
> >         struct vchiq_mmal_component *encode_component = NULL;
> >         struct mmal_fmt *mfmt = get_format(f);
> > -       u32 remove_padding;
> > +       bool remove_padding;
> >
> >         if (!mfmt)
> >                 return -EINVAL;
> > --
> > 2.38.1
> >

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

* Re: [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding
@ 2022-11-18 17:23       ` Dave Stevenson
  0 siblings, 0 replies; 20+ messages in thread
From: Dave Stevenson @ 2022-11-18 17:23 UTC (permalink / raw)
  To: Kieran Bingham
  Cc: Broadcom internal kernel review list, Dan Carpenter,
	Florian Fainelli, Greg Kroah-Hartman, Hans Verkuil,
	Mauro Carvalho Chehab, Ray Jui, Umang Jain, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-staging

On Fri, 18 Nov 2022 at 10:50, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Umang Jain (2022-11-18 08:42:44)
> > mmal_fmt.remove_padding is defined as a boolean type hence, use boolean
> > values for it instead of 0/1 integers. This enhances code readability.
>
> This could be (optionally) expanded:
>
> """
> The field 'remove_padding' in 'struct mmal_fmt' is defined as a boolean
> type.
>
> The initialisation of the formats[] array stores integer 0/1 values into
> this field rather than a more readable bool type.
>
> Convert the usages to boolean true/false, and fix up the local storage
> type in mmal_setup_components() to enhance code readability.
> """

Again I'll agree.

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

>
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> > ---
> >  .../bcm2835-camera/bcm2835-camera.c           | 30 +++++++++----------
> >  1 file changed, 15 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> > index fd456d1f7061..797ebe2a973a 100644
> > --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> > +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> > @@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_YUYV,
> >                 .mmal = MMAL_ENCODING_YUYV,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_RGB24,
> >                 .mmal = MMAL_ENCODING_RGB24,
> >                 .depth = 24,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 3,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_JPEG,
> >                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> > @@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 8,
> >                 .mmal_component = COMP_IMAGE_ENCODE,
> >                 .ybbp = 0,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_H264,
> >                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> > @@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 8,
> >                 .mmal_component = COMP_VIDEO_ENCODE,
> >                 .ybbp = 0,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_MJPEG,
> >                 .flags = V4L2_FMT_FLAG_COMPRESSED,
> > @@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = {
> >                 .depth = 8,
> >                 .mmal_component = COMP_VIDEO_ENCODE,
> >                 .ybbp = 0,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_YVYU,
> >                 .mmal = MMAL_ENCODING_YVYU,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_VYUY,
> >                 .mmal = MMAL_ENCODING_VYUY,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_UYVY,
> >                 .mmal = MMAL_ENCODING_UYVY,
> >                 .depth = 16,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 2,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_NV12,
> >                 .mmal = MMAL_ENCODING_NV12,
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_BGR24,
> >                 .mmal = MMAL_ENCODING_BGR24,
> >                 .depth = 24,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 3,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_YVU420,
> >                 .mmal = MMAL_ENCODING_YV12,
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_NV21,
> >                 .mmal = MMAL_ENCODING_NV21,
> >                 .depth = 12,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 1,
> > -               .remove_padding = 1,
> > +               .remove_padding = true,
> >         }, {
> >                 .fourcc = V4L2_PIX_FMT_BGR32,
> >                 .mmal = MMAL_ENCODING_BGRA,
> >                 .depth = 32,
> >                 .mmal_component = COMP_CAMERA,
> >                 .ybbp = 4,
> > -               .remove_padding = 0,
> > +               .remove_padding = false,
> >         },
> >  };
> >
> > @@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev,
> >         struct vchiq_mmal_port *port = NULL, *camera_port = NULL;
> >         struct vchiq_mmal_component *encode_component = NULL;
> >         struct mmal_fmt *mfmt = get_format(f);
> > -       u32 remove_padding;
> > +       bool remove_padding;
> >
> >         if (!mfmt)
> >                 return -EINVAL;
> > --
> > 2.38.1
> >

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

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

end of thread, other threads:[~2022-11-18 17:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18  8:42 [PATCH v2 0/3] staging: vc04_services: Promote bool usage Umang Jain
2022-11-18  8:42 ` Umang Jain
2022-11-18  8:42 ` [PATCH v2 1/3] Revert "staging: mmal-vchiq: Avoid use of bool in structures" Umang Jain
2022-11-18  8:42   ` Umang Jain
2022-11-18 10:21   ` Kieran Bingham
2022-11-18 10:21     ` Kieran Bingham
2022-11-18 17:20     ` Dave Stevenson
2022-11-18 17:20       ` Dave Stevenson
2022-11-18  8:42 ` [PATCH v2 2/3] vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use Umang Jain
2022-11-18  8:42   ` Umang Jain
2022-11-18 10:30   ` Kieran Bingham
2022-11-18 10:30     ` Kieran Bingham
2022-11-18 17:22     ` Dave Stevenson
2022-11-18 17:22       ` Dave Stevenson
2022-11-18  8:42 ` [PATCH v2 3/3] vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding Umang Jain
2022-11-18  8:42   ` Umang Jain
2022-11-18 10:50   ` Kieran Bingham
2022-11-18 10:50     ` Kieran Bingham
2022-11-18 17:23     ` Dave Stevenson
2022-11-18 17:23       ` Dave Stevenson

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.