diff mbox series

[04/23] media: imx: imx7_mipi_csis: Move static data to top of mipi_csis_dump_regs()

Message ID 20210413023014.28797-5-laurent.pinchart@ideasonboard.com (mailing list archive)
State New
Headers show
Series media: imx: imx7-mipi-csis: Add i.MX8MM support | expand

Commit Message

Laurent Pinchart April 13, 2021, 2:29 a.m. UTC
It's customary to declare static variables at the top of the function,
with a blank line separating them from the non-static variables.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/media/imx/imx7-mipi-csis.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Frieder Schrempf April 26, 2021, 11:46 a.m. UTC | #1
On 13.04.21 04:29, Laurent Pinchart wrote:
> It's customary to declare static variables at the top of the function,
> with a blank line separating them from the non-static variables.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>

> ---
>   drivers/staging/media/imx/imx7-mipi-csis.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
> index f7c8b6d67e1c..25125e067aa7 100644
> --- a/drivers/staging/media/imx/imx7-mipi-csis.c
> +++ b/drivers/staging/media/imx/imx7-mipi-csis.c
> @@ -429,9 +429,6 @@ static inline u32 mipi_csis_read(struct csi_state *state, u32 reg)
>   
>   static int mipi_csis_dump_regs(struct csi_state *state)
>   {
> -	struct device *dev = &state->pdev->dev;
> -	unsigned int i;
> -	u32 cfg;
>   	static const struct {
>   		u32 offset;
>   		const char * const name;
> @@ -450,6 +447,10 @@ static int mipi_csis_dump_regs(struct csi_state *state)
>   		{ MIPI_CSIS_DBG_CTRL, "DBG_CTRL" },
>   	};
>   
> +	struct device *dev = &state->pdev->dev;
> +	unsigned int i;
> +	u32 cfg;
> +
>   	dev_info(dev, "--- REGISTERS ---\n");
>   
>   	for (i = 0; i < ARRAY_SIZE(registers); i++) {
>
diff mbox series

Patch

diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index f7c8b6d67e1c..25125e067aa7 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -429,9 +429,6 @@  static inline u32 mipi_csis_read(struct csi_state *state, u32 reg)
 
 static int mipi_csis_dump_regs(struct csi_state *state)
 {
-	struct device *dev = &state->pdev->dev;
-	unsigned int i;
-	u32 cfg;
 	static const struct {
 		u32 offset;
 		const char * const name;
@@ -450,6 +447,10 @@  static int mipi_csis_dump_regs(struct csi_state *state)
 		{ MIPI_CSIS_DBG_CTRL, "DBG_CTRL" },
 	};
 
+	struct device *dev = &state->pdev->dev;
+	unsigned int i;
+	u32 cfg;
+
 	dev_info(dev, "--- REGISTERS ---\n");
 
 	for (i = 0; i < ARRAY_SIZE(registers); i++) {