linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h
@ 2025-12-29  7:01 Sun Jian
  2025-12-31  9:29 ` Luca Ceresoli
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Sun Jian @ 2025-12-29  7:01 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jonathan Hunter, Sowjanya Komatineni, Luca Ceresoli,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media,
	linux-tegra, linux-staging, linux-kernel, Sun Jian

Sparse warns that tegra210_csi_soc is not declared in tegra210.c.
The symbol is referenced from csi.c, so it must remain global. Move the
declaration to csi.h so users see it via the header and avoid extern
declarations in .c files.

No functional change intended.

Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 drivers/staging/media/tegra-video/csi.c | 4 ----
 drivers/staging/media/tegra-video/csi.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c
index 604185c00a1a..3c3f6e3fd1ec 100644
--- a/drivers/staging/media/tegra-video/csi.c
+++ b/drivers/staging/media/tegra-video/csi.c
@@ -835,10 +835,6 @@ static void tegra_csi_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 }
 
-#if defined(CONFIG_ARCH_TEGRA_210_SOC)
-extern const struct tegra_csi_soc tegra210_csi_soc;
-#endif
-
 static const struct of_device_id tegra_csi_of_id_table[] = {
 #if defined(CONFIG_ARCH_TEGRA_210_SOC)
 	{ .compatible = "nvidia,tegra210-csi", .data = &tegra210_csi_soc },
diff --git a/drivers/staging/media/tegra-video/csi.h b/drivers/staging/media/tegra-video/csi.h
index 3e6e5ee1bb1e..609c5952e050 100644
--- a/drivers/staging/media/tegra-video/csi.h
+++ b/drivers/staging/media/tegra-video/csi.h
@@ -130,6 +130,10 @@ struct tegra_csi_soc {
 	unsigned int tpg_frmrate_table_size;
 };
 
+#if defined(CONFIG_ARCH_TEGRA_210_SOC)
+extern const struct tegra_csi_soc tegra210_csi_soc;
+#endif
+
 /**
  * struct tegra_csi - NVIDIA Tegra CSI device structure
  *
-- 
2.43.0


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

* Re: [PATCH] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h
  2025-12-29  7:01 [PATCH] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
@ 2025-12-31  9:29 ` Luca Ceresoli
  2025-12-31 12:39 ` [PATCH v2 0/2] staging: media: tegra-video: clean up shared SoC declarations Sun Jian
  2026-01-02 11:44 ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Sun Jian
  2 siblings, 0 replies; 11+ messages in thread
From: Luca Ceresoli @ 2025-12-31  9:29 UTC (permalink / raw)
  To: Sun Jian, Thierry Reding
  Cc: Jonathan Hunter, Sowjanya Komatineni, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, linux-media, linux-tegra, linux-staging,
	linux-kernel

Hello Sun,

On Mon Dec 29, 2025 at 8:01 AM CET, Sun Jian wrote:
> Sparse warns that tegra210_csi_soc is not declared in tegra210.c.
> The symbol is referenced from csi.c, so it must remain global. Move the
> declaration to csi.h so users see it via the header and avoid extern
> declarations in .c files.

Can you please add the exact sparse message to your commit log?

>  drivers/staging/media/tegra-video/csi.c | 4 ----
>  drivers/staging/media/tegra-video/csi.h | 4 ++++
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c
> index 604185c00a1a..3c3f6e3fd1ec 100644
> --- a/drivers/staging/media/tegra-video/csi.c
> +++ b/drivers/staging/media/tegra-video/csi.c
> @@ -835,10 +835,6 @@ static void tegra_csi_remove(struct platform_device *pdev)
>  	pm_runtime_disable(&pdev->dev);
>  }
>
> -#if defined(CONFIG_ARCH_TEGRA_210_SOC)
> -extern const struct tegra_csi_soc tegra210_csi_soc;
> -#endif
> -
>  static const struct of_device_id tegra_csi_of_id_table[] = {
>  #if defined(CONFIG_ARCH_TEGRA_210_SOC)
>  	{ .compatible = "nvidia,tegra210-csi", .data = &tegra210_csi_soc },
> diff --git a/drivers/staging/media/tegra-video/csi.h b/drivers/staging/media/tegra-video/csi.h
> index 3e6e5ee1bb1e..609c5952e050 100644
> --- a/drivers/staging/media/tegra-video/csi.h
> +++ b/drivers/staging/media/tegra-video/csi.h
> @@ -130,6 +130,10 @@ struct tegra_csi_soc {
>  	unsigned int tpg_frmrate_table_size;
>  };
>
> +#if defined(CONFIG_ARCH_TEGRA_210_SOC)
> +extern const struct tegra_csi_soc tegra210_csi_soc;
> +#endif

Looks like a good idea indeed.

I checked how other structs shared across .c files are implemented by using
'git grep -w extern -- drivers/staging/media/tegra-video/' and I
discovered:

 * tegra20_vip_soc uses the exact same pattern you are fixing (extern
   declaration in .c file)
 * tegra20_vi_soc and tegra210_vi_soc have the extern declaration in an
   include file already, as you are proposing

So it would be nice to convert tegra20_vip_soc as well, in the same way as
tegra210_csi_soc. It can be a second patch in your v2 series.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v2 0/2] staging: media: tegra-video: clean up shared SoC declarations
  2025-12-29  7:01 [PATCH] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
  2025-12-31  9:29 ` Luca Ceresoli
@ 2025-12-31 12:39 ` Sun Jian
  2025-12-31 12:39   ` [PATCH v2 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
  2025-12-31 12:39   ` [PATCH v2 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h Sun Jian
  2026-01-02 11:44 ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Sun Jian
  2 siblings, 2 replies; 11+ messages in thread
From: Sun Jian @ 2025-12-31 12:39 UTC (permalink / raw)
  To: luca.ceresoli
  Cc: linux-staging, thierry.reding, jonathanh, skomatineni, mchehab,
	linux-tegra, linux-media, gregkh, linux-kernel, Sun Jian

This series cleans up tegra-video SoC data declarations shared across .c
files by moving them to the corresponding headers.

No functional change intended.

---
Changes in v2:
  - Add exact sparse warning line to patch 1 commit message.
  - Add patch 2 moving tegra20_vip_soc declaration to vip.h for consistency.

Changes in v1:
  - Initial version.

Sun Jian (2):
  staging: media: tegra-video: move tegra210_csi_soc declaration to
    csi.h
  staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h

 drivers/staging/media/tegra-video/csi.c | 4 ----
 drivers/staging/media/tegra-video/csi.h | 4 ++++
 drivers/staging/media/tegra-video/vip.c | 4 ----
 drivers/staging/media/tegra-video/vip.h | 4 ++++
 4 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.43.0


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

* [PATCH v2 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h
  2025-12-31 12:39 ` [PATCH v2 0/2] staging: media: tegra-video: clean up shared SoC declarations Sun Jian
@ 2025-12-31 12:39   ` Sun Jian
  2025-12-31 14:01     ` Luca Ceresoli
  2025-12-31 12:39   ` [PATCH v2 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h Sun Jian
  1 sibling, 1 reply; 11+ messages in thread
From: Sun Jian @ 2025-12-31 12:39 UTC (permalink / raw)
  To: luca.ceresoli
  Cc: linux-staging, thierry.reding, jonathanh, skomatineni, mchehab,
	linux-tegra, linux-media, gregkh, linux-kernel, Sun Jian

Sparse warns that tegra210_csi_soc is not declared in tegra210.c.
The symbol is referenced from csi.c, so it must remain global. Move the
declaration to csi.h so users see it via the header and avoid extern
declarations in .c files.

SPARSE: drivers/staging/media/tegra-video/tegra210.c:1214:28: warning: symbol 'tegra210_csi_soc' was not declared. Should it be static?

No functional change intended.

Link: https://lore.kernel.org/linux-staging/DFCAOR6T9DPE.2MOL0K9O3HP1N@bootlin.com/T/
Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 drivers/staging/media/tegra-video/csi.c | 4 ----
 drivers/staging/media/tegra-video/csi.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c
index 604185c00a1a..3c3f6e3fd1ec 100644
--- a/drivers/staging/media/tegra-video/csi.c
+++ b/drivers/staging/media/tegra-video/csi.c
@@ -835,10 +835,6 @@ static void tegra_csi_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 }
 
-#if defined(CONFIG_ARCH_TEGRA_210_SOC)
-extern const struct tegra_csi_soc tegra210_csi_soc;
-#endif
-
 static const struct of_device_id tegra_csi_of_id_table[] = {
 #if defined(CONFIG_ARCH_TEGRA_210_SOC)
 	{ .compatible = "nvidia,tegra210-csi", .data = &tegra210_csi_soc },
diff --git a/drivers/staging/media/tegra-video/csi.h b/drivers/staging/media/tegra-video/csi.h
index 3e6e5ee1bb1e..609c5952e050 100644
--- a/drivers/staging/media/tegra-video/csi.h
+++ b/drivers/staging/media/tegra-video/csi.h
@@ -130,6 +130,10 @@ struct tegra_csi_soc {
 	unsigned int tpg_frmrate_table_size;
 };
 
+#if defined(CONFIG_ARCH_TEGRA_210_SOC)
+extern const struct tegra_csi_soc tegra210_csi_soc;
+#endif
+
 /**
  * struct tegra_csi - NVIDIA Tegra CSI device structure
  *
-- 
2.43.0


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

* [PATCH v2 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h
  2025-12-31 12:39 ` [PATCH v2 0/2] staging: media: tegra-video: clean up shared SoC declarations Sun Jian
  2025-12-31 12:39   ` [PATCH v2 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
@ 2025-12-31 12:39   ` Sun Jian
  2025-12-31 14:01     ` Luca Ceresoli
  1 sibling, 1 reply; 11+ messages in thread
From: Sun Jian @ 2025-12-31 12:39 UTC (permalink / raw)
  To: luca.ceresoli
  Cc: linux-staging, thierry.reding, jonathanh, skomatineni, mchehab,
	linux-tegra, linux-media, gregkh, linux-kernel, Sun Jian

tegra20_vip_soc is shared across translation units but is currently
declared via an extern in vip.c. Move the declaration to vip.h so users get
it via the header and we avoid extern declarations in .c files, matching
the pattern already used by tegra20_vi_soc and tegra210_vi_soc.

Link: https://lore.kernel.org/linux-staging/DFCAOR6T9DPE.2MOL0K9O3HP1N@bootlin.com/T/
Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 drivers/staging/media/tegra-video/vip.c | 4 ----
 drivers/staging/media/tegra-video/vip.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/tegra-video/vip.c b/drivers/staging/media/tegra-video/vip.c
index 5ec717f3afd5..80cd3b113125 100644
--- a/drivers/staging/media/tegra-video/vip.c
+++ b/drivers/staging/media/tegra-video/vip.c
@@ -263,10 +263,6 @@ static void tegra_vip_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 }
 
-#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
-extern const struct tegra_vip_soc tegra20_vip_soc;
-#endif
-
 static const struct of_device_id tegra_vip_of_id_table[] = {
 #if defined(CONFIG_ARCH_TEGRA_2x_SOC)
 	{ .compatible = "nvidia,tegra20-vip", .data = &tegra20_vip_soc },
diff --git a/drivers/staging/media/tegra-video/vip.h b/drivers/staging/media/tegra-video/vip.h
index 32ceaaccbba2..fdded00447e4 100644
--- a/drivers/staging/media/tegra-video/vip.h
+++ b/drivers/staging/media/tegra-video/vip.h
@@ -50,6 +50,10 @@ struct tegra_vip_soc {
 	const struct tegra_vip_ops *ops;
 };
 
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
+extern const struct tegra_vip_soc tegra20_vip_soc;
+#endif
+
 /**
  * struct tegra_vip - NVIDIA Tegra VIP device structure
  *
-- 
2.43.0


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

* Re: [PATCH v2 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h
  2025-12-31 12:39   ` [PATCH v2 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
@ 2025-12-31 14:01     ` Luca Ceresoli
  0 siblings, 0 replies; 11+ messages in thread
From: Luca Ceresoli @ 2025-12-31 14:01 UTC (permalink / raw)
  To: Sun Jian
  Cc: linux-staging, thierry.reding, jonathanh, skomatineni, mchehab,
	linux-tegra, linux-media, gregkh, linux-kernel

On Wed Dec 31, 2025 at 1:39 PM CET, Sun Jian wrote:
> Sparse warns that tegra210_csi_soc is not declared in tegra210.c.
> The symbol is referenced from csi.c, so it must remain global. Move the
> declaration to csi.h so users see it via the header and avoid extern
> declarations in .c files.
>
> SPARSE: drivers/staging/media/tegra-video/tegra210.c:1214:28: warning: symbol 'tegra210_csi_soc' was not declared. Should it be static?
>
> No functional change intended.
>
> Link: https://lore.kernel.org/linux-staging/DFCAOR6T9DPE.2MOL0K9O3HP1N@bootlin.com/T/
> Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>

Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # build tested
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH v2 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h
  2025-12-31 12:39   ` [PATCH v2 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h Sun Jian
@ 2025-12-31 14:01     ` Luca Ceresoli
  0 siblings, 0 replies; 11+ messages in thread
From: Luca Ceresoli @ 2025-12-31 14:01 UTC (permalink / raw)
  To: Sun Jian
  Cc: linux-staging, thierry.reding, jonathanh, skomatineni, mchehab,
	linux-tegra, linux-media, gregkh, linux-kernel

On Wed Dec 31, 2025 at 1:39 PM CET, Sun Jian wrote:
> tegra20_vip_soc is shared across translation units but is currently
> declared via an extern in vip.c. Move the declaration to vip.h so users get
> it via the header and we avoid extern declarations in .c files, matching
> the pattern already used by tegra20_vi_soc and tegra210_vi_soc.
>
> Link: https://lore.kernel.org/linux-staging/DFCAOR6T9DPE.2MOL0K9O3HP1N@bootlin.com/T/
> Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>

Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # build tested
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers
  2025-12-29  7:01 [PATCH] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
  2025-12-31  9:29 ` Luca Ceresoli
  2025-12-31 12:39 ` [PATCH v2 0/2] staging: media: tegra-video: clean up shared SoC declarations Sun Jian
@ 2026-01-02 11:44 ` Sun Jian
  2026-01-02 11:45   ` [PATCH v3 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
                     ` (2 more replies)
  2 siblings, 3 replies; 11+ messages in thread
From: Sun Jian @ 2026-01-02 11:44 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jonathan Hunter, Sowjanya Komatineni, Luca Ceresoli,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media,
	linux-tegra, linux-staging, linux-kernel, Sun Jian

This series cleans up tegra-video SoC data declarations shared across
translation units by moving them to the corresponding headers, avoiding
local extern declarations in .c files.

No functional change intended.

---
Changes in v3:
  - Wrap the SPARSE warning in patch 1 commit message to <= 75 columns.

Changes in v2:
  - Add the exact sparse warning line to patch 1 commit message.
  - Add patch 2 moving tegra20_vip_soc declaration to vip.h for consistency.

Changes in v1:
  - Initial version.

Sun Jian (2):
  staging: media: tegra-video: move tegra210_csi_soc declaration to
    csi.h
  staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h

 drivers/staging/media/tegra-video/csi.c | 4 ----
 drivers/staging/media/tegra-video/csi.h | 4 ++++
 drivers/staging/media/tegra-video/vip.c | 4 ----
 drivers/staging/media/tegra-video/vip.h | 4 ++++
 4 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.43.0


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

* [PATCH v3 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h
  2026-01-02 11:44 ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Sun Jian
@ 2026-01-02 11:45   ` Sun Jian
  2026-01-02 11:45   ` [PATCH v3 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h Sun Jian
  2026-01-02 15:53   ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Luca Ceresoli
  2 siblings, 0 replies; 11+ messages in thread
From: Sun Jian @ 2026-01-02 11:45 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jonathan Hunter, Sowjanya Komatineni, Luca Ceresoli,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media,
	linux-tegra, linux-staging, linux-kernel, Sun Jian

Sparse warns that tegra210_csi_soc is not declared in tegra210.c.
The symbol is referenced from csi.c, so it must remain global. Move the
declaration to csi.h so users see it via the header and avoid extern
declarations in .c files.

SPARSE: drivers/staging/media/tegra-video/tegra210.c:1214:28: warning:
 symbol 'tegra210_csi_soc' was not declared. Should it be static?

No functional change intended.

Link: https://lore.kernel.org/linux-staging/DFCAOR6T9DPE.2MOL0K9O3HP1N@bootlin.com/T/
Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 drivers/staging/media/tegra-video/csi.c | 4 ----
 drivers/staging/media/tegra-video/csi.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c
index 604185c00a1a..3c3f6e3fd1ec 100644
--- a/drivers/staging/media/tegra-video/csi.c
+++ b/drivers/staging/media/tegra-video/csi.c
@@ -835,10 +835,6 @@ static void tegra_csi_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 }
 
-#if defined(CONFIG_ARCH_TEGRA_210_SOC)
-extern const struct tegra_csi_soc tegra210_csi_soc;
-#endif
-
 static const struct of_device_id tegra_csi_of_id_table[] = {
 #if defined(CONFIG_ARCH_TEGRA_210_SOC)
 	{ .compatible = "nvidia,tegra210-csi", .data = &tegra210_csi_soc },
diff --git a/drivers/staging/media/tegra-video/csi.h b/drivers/staging/media/tegra-video/csi.h
index 3e6e5ee1bb1e..609c5952e050 100644
--- a/drivers/staging/media/tegra-video/csi.h
+++ b/drivers/staging/media/tegra-video/csi.h
@@ -130,6 +130,10 @@ struct tegra_csi_soc {
 	unsigned int tpg_frmrate_table_size;
 };
 
+#if defined(CONFIG_ARCH_TEGRA_210_SOC)
+extern const struct tegra_csi_soc tegra210_csi_soc;
+#endif
+
 /**
  * struct tegra_csi - NVIDIA Tegra CSI device structure
  *
-- 
2.43.0


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

* [PATCH v3 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h
  2026-01-02 11:44 ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Sun Jian
  2026-01-02 11:45   ` [PATCH v3 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
@ 2026-01-02 11:45   ` Sun Jian
  2026-01-02 15:53   ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Luca Ceresoli
  2 siblings, 0 replies; 11+ messages in thread
From: Sun Jian @ 2026-01-02 11:45 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jonathan Hunter, Sowjanya Komatineni, Luca Ceresoli,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media,
	linux-tegra, linux-staging, linux-kernel, Sun Jian

tegra20_vip_soc is shared across translation units but is currently
declared via an extern in vip.c. Move the declaration to vip.h so users get
it via the header and we avoid extern declarations in .c files, matching
the pattern already used by tegra20_vi_soc and tegra210_vi_soc.

Link: https://lore.kernel.org/linux-staging/DFCAOR6T9DPE.2MOL0K9O3HP1N@bootlin.com/T/
Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 drivers/staging/media/tegra-video/vip.c | 4 ----
 drivers/staging/media/tegra-video/vip.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/tegra-video/vip.c b/drivers/staging/media/tegra-video/vip.c
index 5ec717f3afd5..80cd3b113125 100644
--- a/drivers/staging/media/tegra-video/vip.c
+++ b/drivers/staging/media/tegra-video/vip.c
@@ -263,10 +263,6 @@ static void tegra_vip_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 }
 
-#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
-extern const struct tegra_vip_soc tegra20_vip_soc;
-#endif
-
 static const struct of_device_id tegra_vip_of_id_table[] = {
 #if defined(CONFIG_ARCH_TEGRA_2x_SOC)
 	{ .compatible = "nvidia,tegra20-vip", .data = &tegra20_vip_soc },
diff --git a/drivers/staging/media/tegra-video/vip.h b/drivers/staging/media/tegra-video/vip.h
index 32ceaaccbba2..fdded00447e4 100644
--- a/drivers/staging/media/tegra-video/vip.h
+++ b/drivers/staging/media/tegra-video/vip.h
@@ -50,6 +50,10 @@ struct tegra_vip_soc {
 	const struct tegra_vip_ops *ops;
 };
 
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
+extern const struct tegra_vip_soc tegra20_vip_soc;
+#endif
+
 /**
  * struct tegra_vip - NVIDIA Tegra VIP device structure
  *
-- 
2.43.0


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

* Re: [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers
  2026-01-02 11:44 ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Sun Jian
  2026-01-02 11:45   ` [PATCH v3 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
  2026-01-02 11:45   ` [PATCH v3 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h Sun Jian
@ 2026-01-02 15:53   ` Luca Ceresoli
  2 siblings, 0 replies; 11+ messages in thread
From: Luca Ceresoli @ 2026-01-02 15:53 UTC (permalink / raw)
  To: Sun Jian, Thierry Reding
  Cc: Jonathan Hunter, Sowjanya Komatineni, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, linux-media, linux-tegra, linux-staging,
	linux-kernel

On Fri Jan 2, 2026 at 12:44 PM CET, Sun Jian wrote:
> This series cleans up tegra-video SoC data declarations shared across
> translation units by moving them to the corresponding headers, avoiding
> local extern declarations in .c files.
>
> No functional change intended.
>
> ---
> Changes in v3:
>   - Wrap the SPARSE warning in patch 1 commit message to <= 75 columns.

My understanding and my knowledge of the common practice is that you
shouldn't wrap lines if they are quoting a single path, log message, error
message and the like.

So I think v2 should be applied, not v3. But I'll leave the decision to
maintainers applying the patches.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2026-01-02 15:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-29  7:01 [PATCH] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
2025-12-31  9:29 ` Luca Ceresoli
2025-12-31 12:39 ` [PATCH v2 0/2] staging: media: tegra-video: clean up shared SoC declarations Sun Jian
2025-12-31 12:39   ` [PATCH v2 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
2025-12-31 14:01     ` Luca Ceresoli
2025-12-31 12:39   ` [PATCH v2 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h Sun Jian
2025-12-31 14:01     ` Luca Ceresoli
2026-01-02 11:44 ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Sun Jian
2026-01-02 11:45   ` [PATCH v3 1/2] staging: media: tegra-video: move tegra210_csi_soc declaration to csi.h Sun Jian
2026-01-02 11:45   ` [PATCH v3 2/2] staging: media: tegra-video: move tegra20_vip_soc declaration to vip.h Sun Jian
2026-01-02 15:53   ` [PATCH v3 0/2] staging: media: tegra-video: move shared SoC declarations to headers Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).