* [PATCH 1/4] staging: greybus: spilib: fix function parameter indentation
2025-12-19 6:34 [PATCH 0/4] greybus: staging fixes and cleanups Zhan Xusheng
@ 2025-12-19 6:34 ` Zhan Xusheng
2025-12-22 8:45 ` Greg KH
2025-12-19 6:34 ` [PATCH 2/4] staging: greybus: audio: avoid macro with side effects Zhan Xusheng
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Zhan Xusheng @ 2025-12-19 6:34 UTC (permalink / raw)
To: linux-staging; +Cc: Zhan Xusheng
Fix checkpatch.pl warning:
"Alignment should match open parenthesis"
by aligning wrapped function parameters with
the opening parenthesis.
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
drivers/staging/greybus/spilib.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/spilib.c b/drivers/staging/greybus/spilib.c
index 24e9c909fa02..416ca27a25ce 100644
--- a/drivers/staging/greybus/spilib.c
+++ b/drivers/staging/greybus/spilib.c
@@ -159,8 +159,10 @@ static struct spi_transfer *get_next_xfer(struct spi_transfer *xfer,
}
/* Routines to transfer data */
-static struct gb_operation *gb_spi_operation_create(struct gb_spilib *spi,
- struct gb_connection *connection, struct spi_message *msg)
+static struct gb_operation *
+gb_spi_operation_create(struct gb_spilib *spi,
+ struct gb_connection *connection,
+ struct spi_message *msg)
{
struct gb_spi_transfer_request *request;
struct spi_device *dev = msg->spi;
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 1/4] staging: greybus: spilib: fix function parameter indentation
2025-12-19 6:34 ` [PATCH 1/4] staging: greybus: spilib: fix function parameter indentation Zhan Xusheng
@ 2025-12-22 8:45 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2025-12-22 8:45 UTC (permalink / raw)
To: Zhan Xusheng; +Cc: linux-staging, Zhan Xusheng
On Fri, Dec 19, 2025 at 02:34:12PM +0800, Zhan Xusheng wrote:
> Fix checkpatch.pl warning:
> "Alignment should match open parenthesis"
> by aligning wrapped function parameters with
> the opening parenthesis.
>
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
> ---
> drivers/staging/greybus/spilib.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/spilib.c b/drivers/staging/greybus/spilib.c
> index 24e9c909fa02..416ca27a25ce 100644
> --- a/drivers/staging/greybus/spilib.c
> +++ b/drivers/staging/greybus/spilib.c
> @@ -159,8 +159,10 @@ static struct spi_transfer *get_next_xfer(struct spi_transfer *xfer,
> }
>
> /* Routines to transfer data */
> -static struct gb_operation *gb_spi_operation_create(struct gb_spilib *spi,
> - struct gb_connection *connection, struct spi_message *msg)
> +static struct gb_operation *
> +gb_spi_operation_create(struct gb_spilib *spi,
> + struct gb_connection *connection,
> + struct spi_message *msg)
This is where things get messy :(
The original is still best, as you can see the function name, and the
return type, on the same line, which many search tools really want to
show you when searching code.
So the existing code is fine, no need to worry about this warning here.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/4] staging: greybus: audio: avoid macro with side effects
2025-12-19 6:34 [PATCH 0/4] greybus: staging fixes and cleanups Zhan Xusheng
2025-12-19 6:34 ` [PATCH 1/4] staging: greybus: spilib: fix function parameter indentation Zhan Xusheng
@ 2025-12-19 6:34 ` Zhan Xusheng
2025-12-22 8:46 ` Greg KH
2025-12-19 6:34 ` [PATCH 3/4] staging: greybus: gb-camera: use BIT() macro and fix formatting Zhan Xusheng
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Zhan Xusheng @ 2025-12-19 6:34 UTC (permalink / raw)
To: linux-staging; +Cc: Zhan Xusheng
The gbaudio_dapm_for_each_direction() macro modifies its argument and
evaluates it multiple times, which can lead to subtle bugs if used with
expressions that have side effects.
Replace the macro with an explicit for-loop to improve readability and
avoid potential side effects.
No functional changes.
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
drivers/staging/greybus/audio_helper.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/staging/greybus/audio_helper.c b/drivers/staging/greybus/audio_helper.c
index b4873c6d6bed..6264cafe9675 100644
--- a/drivers/staging/greybus/audio_helper.c
+++ b/drivers/staging/greybus/audio_helper.c
@@ -8,10 +8,6 @@
#include <sound/soc-dapm.h>
#include "audio_helper.h"
-#define gbaudio_dapm_for_each_direction(dir) \
- for ((dir) = SND_SOC_DAPM_DIR_IN; (dir) <= SND_SOC_DAPM_DIR_OUT; \
- (dir)++)
-
static void gbaudio_dapm_link_dai_widget(struct snd_soc_dapm_widget *dai_w,
struct snd_soc_card *card)
{
@@ -98,7 +94,7 @@ static void gbaudio_dapm_free_widget(struct snd_soc_dapm_widget *w)
* While removing the path, remove reference to it from both
* source and sink widgets so that path is removed only once.
*/
- gbaudio_dapm_for_each_direction(dir) {
+ for (dir = SND_SOC_DAPM_DIR_IN; dir <= SND_SOC_DAPM_DIR_OUT; dir++) {
snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p)
gbaudio_dapm_free_path(p);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 3/4] staging: greybus: gb-camera: use BIT() macro and fix formatting
2025-12-19 6:34 [PATCH 0/4] greybus: staging fixes and cleanups Zhan Xusheng
2025-12-19 6:34 ` [PATCH 1/4] staging: greybus: spilib: fix function parameter indentation Zhan Xusheng
2025-12-19 6:34 ` [PATCH 2/4] staging: greybus: audio: avoid macro with side effects Zhan Xusheng
@ 2025-12-19 6:34 ` Zhan Xusheng
2025-12-22 8:46 ` Greg KH
2025-12-19 6:34 ` [PATCH 4/4] staging: greybus: greybus_firmware: fix long macro lines Zhan Xusheng
2025-12-22 15:40 ` [PATCH 1/4] staging: greybus: gb-camera: use BIT() macro and fix formatting Zhan Xusheng
4 siblings, 1 reply; 10+ messages in thread
From: Zhan Xusheng @ 2025-12-19 6:34 UTC (permalink / raw)
To: linux-staging; +Cc: Zhan Xusheng
Replace `(1 << 0)` with the `BIT(0)` macro for input/output flags
to follow Linux kernel style.
Also adjust the indentation of gb_camera_ops->configure_streams
parameters to match kernel coding style.
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
drivers/staging/greybus/gb-camera.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/greybus/gb-camera.h b/drivers/staging/greybus/gb-camera.h
index 3e09147435a5..d5a33a13f2a4 100644
--- a/drivers/staging/greybus/gb-camera.h
+++ b/drivers/staging/greybus/gb-camera.h
@@ -10,9 +10,9 @@
#include <linux/v4l2-mediabus.h>
/* Input flags need to be set from the caller */
-#define GB_CAMERA_IN_FLAG_TEST (1 << 0)
+#define GB_CAMERA_IN_FLAG_TEST BIT(0)
/* Output flags returned */
-#define GB_CAMERA_OUT_FLAG_ADJUSTED (1 << 0)
+#define GB_CAMERA_OUT_FLAG_ADJUSTED BIT(0)
/**
* struct gb_camera_stream - Represents greybus camera stream.
@@ -89,8 +89,9 @@ struct gb_camera_csi_params {
struct gb_camera_ops {
ssize_t (*capabilities)(void *priv, char *buf, size_t len);
int (*configure_streams)(void *priv, unsigned int *nstreams,
- unsigned int *flags, struct gb_camera_stream *streams,
- struct gb_camera_csi_params *csi_params);
+ unsigned int *flags,
+ struct gb_camera_stream *streams,
+ struct gb_camera_csi_params *csi_params);
int (*capture)(void *priv, u32 request_id,
unsigned int streams, unsigned int num_frames,
size_t settings_size, const void *settings);
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 4/4] staging: greybus: greybus_firmware: fix long macro lines
2025-12-19 6:34 [PATCH 0/4] greybus: staging fixes and cleanups Zhan Xusheng
` (2 preceding siblings ...)
2025-12-19 6:34 ` [PATCH 3/4] staging: greybus: gb-camera: use BIT() macro and fix formatting Zhan Xusheng
@ 2025-12-19 6:34 ` Zhan Xusheng
2025-12-22 8:47 ` Greg KH
2025-12-22 15:40 ` [PATCH 1/4] staging: greybus: gb-camera: use BIT() macro and fix formatting Zhan Xusheng
4 siblings, 1 reply; 10+ messages in thread
From: Zhan Xusheng @ 2025-12-19 6:34 UTC (permalink / raw)
To: linux-staging; +Cc: Zhan Xusheng
Break long ioctl macro definitions into multiple lines to satisfy
checkpatch.pl line-length checks (<100 columns).
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
drivers/staging/greybus/greybus_firmware.h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/greybus/greybus_firmware.h b/drivers/staging/greybus/greybus_firmware.h
index b6042a82ada4..f59a2def3d45 100644
--- a/drivers/staging/greybus/greybus_firmware.h
+++ b/drivers/staging/greybus/greybus_firmware.h
@@ -64,11 +64,16 @@ struct fw_mgmt_ioc_backend_fw_update {
} __packed;
#define FW_MGMT_IOCTL_BASE 'F'
-#define FW_MGMT_IOC_GET_INTF_FW _IOR(FW_MGMT_IOCTL_BASE, 0, struct fw_mgmt_ioc_get_intf_version)
-#define FW_MGMT_IOC_GET_BACKEND_FW _IOWR(FW_MGMT_IOCTL_BASE, 1, struct fw_mgmt_ioc_get_backend_version)
-#define FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE _IOWR(FW_MGMT_IOCTL_BASE, 2, struct fw_mgmt_ioc_intf_load_and_validate)
-#define FW_MGMT_IOC_INTF_BACKEND_FW_UPDATE _IOWR(FW_MGMT_IOCTL_BASE, 3, struct fw_mgmt_ioc_backend_fw_update)
-#define FW_MGMT_IOC_SET_TIMEOUT_MS _IOW(FW_MGMT_IOCTL_BASE, 4, unsigned int)
+#define FW_MGMT_IOC_GET_INTF_FW \
+ _IOR(FW_MGMT_IOCTL_BASE, 0, struct fw_mgmt_ioc_get_intf_version)
+#define FW_MGMT_IOC_GET_BACKEND_FW \
+ _IOWR(FW_MGMT_IOCTL_BASE, 1, struct fw_mgmt_ioc_get_backend_version)
+#define FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE \
+ _IOWR(FW_MGMT_IOCTL_BASE, 2, struct fw_mgmt_ioc_intf_load_and_validate)
+#define FW_MGMT_IOC_INTF_BACKEND_FW_UPDATE \
+ _IOWR(FW_MGMT_IOCTL_BASE, 3, struct fw_mgmt_ioc_backend_fw_update)
+#define FW_MGMT_IOC_SET_TIMEOUT_MS \
+ _IOW(FW_MGMT_IOCTL_BASE, 4, unsigned int)
#define FW_MGMT_IOC_MODE_SWITCH _IO(FW_MGMT_IOCTL_BASE, 5)
#endif /* __GREYBUS_FIRMWARE_USER_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 4/4] staging: greybus: greybus_firmware: fix long macro lines
2025-12-19 6:34 ` [PATCH 4/4] staging: greybus: greybus_firmware: fix long macro lines Zhan Xusheng
@ 2025-12-22 8:47 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2025-12-22 8:47 UTC (permalink / raw)
To: Zhan Xusheng; +Cc: linux-staging, Zhan Xusheng
On Fri, Dec 19, 2025 at 02:34:15PM +0800, Zhan Xusheng wrote:
> Break long ioctl macro definitions into multiple lines to satisfy
> checkpatch.pl line-length checks (<100 columns).
>
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
> ---
> drivers/staging/greybus/greybus_firmware.h | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/greybus/greybus_firmware.h b/drivers/staging/greybus/greybus_firmware.h
> index b6042a82ada4..f59a2def3d45 100644
> --- a/drivers/staging/greybus/greybus_firmware.h
> +++ b/drivers/staging/greybus/greybus_firmware.h
> @@ -64,11 +64,16 @@ struct fw_mgmt_ioc_backend_fw_update {
> } __packed;
>
> #define FW_MGMT_IOCTL_BASE 'F'
> -#define FW_MGMT_IOC_GET_INTF_FW _IOR(FW_MGMT_IOCTL_BASE, 0, struct fw_mgmt_ioc_get_intf_version)
> -#define FW_MGMT_IOC_GET_BACKEND_FW _IOWR(FW_MGMT_IOCTL_BASE, 1, struct fw_mgmt_ioc_get_backend_version)
> -#define FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE _IOWR(FW_MGMT_IOCTL_BASE, 2, struct fw_mgmt_ioc_intf_load_and_validate)
> -#define FW_MGMT_IOC_INTF_BACKEND_FW_UPDATE _IOWR(FW_MGMT_IOCTL_BASE, 3, struct fw_mgmt_ioc_backend_fw_update)
> -#define FW_MGMT_IOC_SET_TIMEOUT_MS _IOW(FW_MGMT_IOCTL_BASE, 4, unsigned int)
> +#define FW_MGMT_IOC_GET_INTF_FW \
> + _IOR(FW_MGMT_IOCTL_BASE, 0, struct fw_mgmt_ioc_get_intf_version)
> +#define FW_MGMT_IOC_GET_BACKEND_FW \
> + _IOWR(FW_MGMT_IOCTL_BASE, 1, struct fw_mgmt_ioc_get_backend_version)
> +#define FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE \
> + _IOWR(FW_MGMT_IOCTL_BASE, 2, struct fw_mgmt_ioc_intf_load_and_validate)
> +#define FW_MGMT_IOC_INTF_BACKEND_FW_UPDATE \
> + _IOWR(FW_MGMT_IOCTL_BASE, 3, struct fw_mgmt_ioc_backend_fw_update)
> +#define FW_MGMT_IOC_SET_TIMEOUT_MS \
> + _IOW(FW_MGMT_IOCTL_BASE, 4, unsigned int)
The originals are fine, ioctls are messy, it's good to see them all on
one line usually.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] staging: greybus: gb-camera: use BIT() macro and fix formatting
2025-12-19 6:34 [PATCH 0/4] greybus: staging fixes and cleanups Zhan Xusheng
` (3 preceding siblings ...)
2025-12-19 6:34 ` [PATCH 4/4] staging: greybus: greybus_firmware: fix long macro lines Zhan Xusheng
@ 2025-12-22 15:40 ` Zhan Xusheng
4 siblings, 0 replies; 10+ messages in thread
From: Zhan Xusheng @ 2025-12-22 15:40 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, Zhan Xusheng
Thanks for the review!
I've split the original patch into a v2 series as suggested and
resent it to the mailing list.
^ permalink raw reply [flat|nested] 10+ messages in thread