[PATCH] staging: media: atomisp: fix variable shadowing warnings

From: Rhys Tumelty

Date: Mon Jun 08 2026 - 11:48:05 EST


Fix local variable shadowing warnings, flagged by a W=2
kernel build, due to -Werror=shadow.

In atomisp_css_stop(), an inner loop 'i' index shadows
an outer unsigned int i. Rename the inner loop index to 'k'

In ia_css_stream_create(), the block-local 'effective_res'
struct shadows an outer local declaration. Rename the
block scoped instance in the loop over pipes to
'pipe_effective_res' to clearly show context.

Signed-off-by: Rhys Tumelty <rhys@xxxxxxxxxxxxx>
---
.../media/atomisp/pci/atomisp_compat_css20.c | 6 +++---
drivers/staging/media/atomisp/pci/sh_css.c | 14 +++++++-------
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index be5f37f4a6fd..da945fddb5ea 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -1775,10 +1775,10 @@ void atomisp_css_stop(struct atomisp_sub_device *asd, bool in_reset)

if (!in_reset) {
struct atomisp_stream_env *stream_env;
- int i, j;
+ int k, j;

- for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++) {
- stream_env = &asd->stream_env[i];
+ for (k = 0; k < ATOMISP_INPUT_STREAM_NUM; k++) {
+ stream_env = &asd->stream_env[k];
for (j = 0; j < IA_CSS_PIPE_ID_NUM; j++) {
ia_css_pipe_config_defaults(
&stream_env->pipe_configs[j]);
diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c
index cd1be313c758..44c77179abb8 100644
--- a/drivers/staging/media/atomisp/pci/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/sh_css.c
@@ -7971,22 +7971,22 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
}

for (i = 0; i < num_pipes; i++) {
- struct ia_css_resolution effective_res;
+ struct ia_css_resolution pipe_effective_res;

curr_pipe = pipes[i];
/* set current stream */
curr_pipe->stream = curr_stream;
/* take over effective info */

- effective_res = curr_pipe->config.input_effective_res;
- if (effective_res.height == 0 || effective_res.width == 0) {
- effective_res = curr_pipe->stream->config.input_config.effective_res;
+ pipe_effective_res = curr_pipe->config.input_effective_res;
+ if (pipe_effective_res.height == 0 || pipe_effective_res.width == 0) {
+ pipe_effective_res = curr_pipe->stream->config.input_config.effective_res;

- curr_pipe->config.input_effective_res = effective_res;
+ curr_pipe->config.input_effective_res = pipe_effective_res;
}
IA_CSS_LOG("effective_res=%dx%d",
- effective_res.width,
- effective_res.height);
+ pipe_effective_res.width,
+ pipe_effective_res.height);
}

err = ia_css_stream_isp_parameters_init(curr_stream);
--
2.54.0