* [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
@ 2026-04-11 0:55 Michael Ugrin
2026-04-11 10:51 ` Dan Carpenter
2026-04-11 17:34 ` [PATCH v2] staging: media: atomisp: use umin() for strscpy size arguments Michael Ugrin
0 siblings, 2 replies; 9+ messages in thread
From: Michael Ugrin @ 2026-04-11 0:55 UTC (permalink / raw)
To: hansg, mchehab
Cc: sakari.ailus, andy, gregkh, linux-media, linux-kernel,
linux-staging, Michael Ugrin
Fix whitespace issue where a continuation line used spaces
instead of tabs for indentation.
Signed-off-by: Michael Ugrin <mugrinphoto@gmail.com>
---
.../staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
index b411ca2f415e0..966d4efb200c5 100644
--- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
+++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
@@ -1257,7 +1257,7 @@ ia_css_debug_pipe_graph_dump_stage(
p--;
/* Last comma found, copy till that comma */
strscpy(enable_info1, ei,
- p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
+ p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
ei += p + 1;
l = strlen(ei);
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
2026-04-11 0:55 [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces Michael Ugrin
@ 2026-04-11 10:51 ` Dan Carpenter
2026-04-11 14:42 ` David Laight
2026-04-11 17:34 ` [PATCH v2] staging: media: atomisp: use umin() for strscpy size arguments Michael Ugrin
1 sibling, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2026-04-11 10:51 UTC (permalink / raw)
To: Michael Ugrin
Cc: hansg, mchehab, sakari.ailus, andy, gregkh, linux-media,
linux-kernel, linux-staging
On Fri, Apr 10, 2026 at 05:55:12PM -0700, Michael Ugrin wrote:
> Fix whitespace issue where a continuation line used spaces
> instead of tabs for indentation.
>
> Signed-off-by: Michael Ugrin <mugrinphoto@gmail.com>
> ---
> .../staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> index b411ca2f415e0..966d4efb200c5 100644
> --- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> +++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> @@ -1257,7 +1257,7 @@ ia_css_debug_pipe_graph_dump_stage(
> p--;
> /* Last comma found, copy till that comma */
> strscpy(enable_info1, ei,
> - p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
> + p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
Better to use:
strscpy(enable_info1, ei, umin(p, sizeof(enable_info1)));
Same for the other strscpy() calls as well.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
2026-04-11 10:51 ` Dan Carpenter
@ 2026-04-11 14:42 ` David Laight
2026-04-11 17:13 ` Michael Ugrin
0 siblings, 1 reply; 9+ messages in thread
From: David Laight @ 2026-04-11 14:42 UTC (permalink / raw)
To: Dan Carpenter
Cc: Michael Ugrin, hansg, mchehab, sakari.ailus, andy, gregkh,
linux-media, linux-kernel, linux-staging
On Sat, 11 Apr 2026 13:51:35 +0300
Dan Carpenter <error27@gmail.com> wrote:
> On Fri, Apr 10, 2026 at 05:55:12PM -0700, Michael Ugrin wrote:
> > Fix whitespace issue where a continuation line used spaces
> > instead of tabs for indentation.
> >
> > Signed-off-by: Michael Ugrin <mugrinphoto@gmail.com>
> > ---
> > .../staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> > index b411ca2f415e0..966d4efb200c5 100644
> > --- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> > +++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> > @@ -1257,7 +1257,7 @@ ia_css_debug_pipe_graph_dump_stage(
> > p--;
> > /* Last comma found, copy till that comma */
> > strscpy(enable_info1, ei,
> > - p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
> > + p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
>
> Better to use:
>
> strscpy(enable_info1, ei, umin(p, sizeof(enable_info1)));
>
> Same for the other strscpy() calls as well.
Or refactor that code so it doesn't use 600+ bytes of stack and
lots of scanning of long strings.
From a quick scan it seems to be generating a string of xxx,yyy, with the ','
replaced by '\n' to avoid anything longer than 25 characters and at most three lines.
I'm sure you could write and use a function that lets you have a lot of lines like:
offset = add_flag(info, offset, bi->enable.reduced_pipe, "rp");
Oh, and none of your char_enable_info[] arrays are guaranteed to
be aligned either.
So all the snprint and strscpy calls into different buffers are pointless.
David
>
> regards,
> dan carpenter
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
2026-04-11 14:42 ` David Laight
@ 2026-04-11 17:13 ` Michael Ugrin
2026-04-13 7:24 ` Andy Shevchenko
0 siblings, 1 reply; 9+ messages in thread
From: Michael Ugrin @ 2026-04-11 17:13 UTC (permalink / raw)
To: David Laight
Cc: Dan Carpenter, hansg, mchehab, sakari.ailus, andy, gregkh,
linux-media, linux-kernel, linux-staging
Thanks for the review, Dan and David.
I'll work on a v2,replacing the ternary with umin() for that strscpy
call and the other strscpy calls in the function.
The larger refactor to eliminate the stack buffers and build the
output incrementally sounds like a great improvement. I'm a new
contributor and that's beyond my scope for this patch, but I'd like to
come back and tackle it as a separate effort once I'm more comfortable
with the codebase.
Thanks again for the guidance.
- Michael
On Sat, Apr 11, 2026 at 7:42 AM David Laight
<david.laight.linux@gmail.com> wrote:
>
> On Sat, 11 Apr 2026 13:51:35 +0300
> Dan Carpenter <error27@gmail.com> wrote:
>
> > On Fri, Apr 10, 2026 at 05:55:12PM -0700, Michael Ugrin wrote:
> > > Fix whitespace issue where a continuation line used spaces
> > > instead of tabs for indentation.
> > >
> > > Signed-off-by: Michael Ugrin <mugrinphoto@gmail.com>
> > > ---
> > > .../staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> > > index b411ca2f415e0..966d4efb200c5 100644
> > > --- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> > > +++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
> > > @@ -1257,7 +1257,7 @@ ia_css_debug_pipe_graph_dump_stage(
> > > p--;
> > > /* Last comma found, copy till that comma */
> > > strscpy(enable_info1, ei,
> > > - p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
> > > + p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
> >
> > Better to use:
> >
> > strscpy(enable_info1, ei, umin(p, sizeof(enable_info1)));
> >
> > Same for the other strscpy() calls as well.
>
> Or refactor that code so it doesn't use 600+ bytes of stack and
> lots of scanning of long strings.
>
> From a quick scan it seems to be generating a string of xxx,yyy, with the ','
> replaced by '\n' to avoid anything longer than 25 characters and at most three lines.
> I'm sure you could write and use a function that lets you have a lot of lines like:
> offset = add_flag(info, offset, bi->enable.reduced_pipe, "rp");
>
> Oh, and none of your char_enable_info[] arrays are guaranteed to
> be aligned either.
> So all the snprint and strscpy calls into different buffers are pointless.
>
> David
>
> >
> > regards,
> > dan carpenter
> >
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] staging: media: atomisp: use umin() for strscpy size arguments
2026-04-11 0:55 [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces Michael Ugrin
2026-04-11 10:51 ` Dan Carpenter
@ 2026-04-11 17:34 ` Michael Ugrin
2026-04-13 7:01 ` Dan Carpenter
1 sibling, 1 reply; 9+ messages in thread
From: Michael Ugrin @ 2026-04-11 17:34 UTC (permalink / raw)
To: hansg, mchehab
Cc: sakari.ailus, andy, gregkh, Dan Carpenter, David Laight,
linux-media, linux-kernel, linux-staging, Michael Ugrin
Replace open-coded ternary min expressions with umin() in
strscpy() calls, as suggested by Dan Carpenter.
Signed-off-by: Michael Ugrin <mugrinphoto@gmail.com>
---
.../atomisp/pci/runtime/debug/src/ia_css_debug.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
index b411ca2f415e0..60bb10dac5891 100644
--- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
+++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
@@ -1256,8 +1256,7 @@ ia_css_debug_pipe_graph_dump_stage(
while (ei[p] != ',')
p--;
/* Last comma found, copy till that comma */
- strscpy(enable_info1, ei,
- p > sizeof(enable_info1) ? sizeof(enable_info1) : p);
+ strscpy(enable_info1, ei, umin(p, sizeof(enable_info1)));
ei += p + 1;
l = strlen(ei);
@@ -1268,8 +1267,7 @@ ia_css_debug_pipe_graph_dump_stage(
* it is not guaranteed dword aligned
*/
- strscpy(enable_info2, ei,
- l > sizeof(enable_info2) ? sizeof(enable_info2) : l);
+ strscpy(enable_info2, ei, umin(l, sizeof(enable_info2)));
snprintf(enable_info, sizeof(enable_info), "%s\\n%s",
enable_info1, enable_info2);
@@ -1280,8 +1278,7 @@ ia_css_debug_pipe_graph_dump_stage(
while (ei[p] != ',')
p--;
- strscpy(enable_info2, ei,
- p > sizeof(enable_info2) ? sizeof(enable_info2) : p);
+ strscpy(enable_info2, ei, umin(p, sizeof(enable_info2)));
ei += p + 1;
l = strlen(ei);
@@ -1303,7 +1300,7 @@ ia_css_debug_pipe_graph_dump_stage(
while (ei[p] != ',')
p--;
strscpy(enable_info3, ei,
- p > sizeof(enable_info3) ? sizeof(enable_info3) : p);
+ umin(p, sizeof(enable_info3)));
ei += p + 1;
strscpy(enable_info3, ei,
sizeof(enable_info3));
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2] staging: media: atomisp: use umin() for strscpy size arguments
2026-04-11 17:34 ` [PATCH v2] staging: media: atomisp: use umin() for strscpy size arguments Michael Ugrin
@ 2026-04-13 7:01 ` Dan Carpenter
0 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2026-04-13 7:01 UTC (permalink / raw)
To: Michael Ugrin
Cc: hansg, mchehab, sakari.ailus, andy, gregkh, David Laight,
linux-media, linux-kernel, linux-staging
On Sat, Apr 11, 2026 at 10:34:05AM -0700, Michael Ugrin wrote:
> Replace open-coded ternary min expressions with umin() in
> strscpy() calls, as suggested by Dan Carpenter.
>
> Signed-off-by: Michael Ugrin <mugrinphoto@gmail.com>
> ---
LGTM.
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
2026-04-11 17:13 ` Michael Ugrin
@ 2026-04-13 7:24 ` Andy Shevchenko
0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2026-04-13 7:24 UTC (permalink / raw)
To: Michael Ugrin
Cc: David Laight, Dan Carpenter, hansg, mchehab, sakari.ailus, andy,
gregkh, linux-media, linux-kernel, linux-staging
On Sat, Apr 11, 2026 at 8:14 PM Michael Ugrin <mugrinphoto@gmail.com> wrote:
>
> Thanks for the review, Dan and David.
>
> I'll work on a v2,replacing the ternary with umin() for that strscpy
> call and the other strscpy calls in the function.
Why not simply min()? Wouldn't it work (if type of p is aligned accordingly)?
Note, we prefer the (more) real patches, id est what David suggested
seems to me more useful to this driver to have in the long term.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
@ 2026-06-22 18:49 Batu Ada Tutkun
2026-06-22 18:54 ` Batu Ada Tutkun
0 siblings, 1 reply; 9+ messages in thread
From: Batu Ada Tutkun @ 2026-06-22 18:49 UTC (permalink / raw)
To: hansg, gregkh; +Cc: linux-staging, linux-media, Batu Ada Tutkun
Function parameters in ia_css_cnr.host.c and sp.c were indented
with spaces instead of tabs, violating the kernel coding style.
Replace leading spaces with tabs.
Signed-off-by: Batu Ada Tutkun <batuadatutkun@gmail.com>
---
.../staging/media/atomisp/pci/hive_isp_css_common/host/sp.c | 4 ++--
.../atomisp/pci/isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/sp.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/sp.c
index 0fb8a6754..35a7fd270 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/sp.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/sp.c
@@ -13,8 +13,8 @@
#include "assert_support.h"
void cnd_sp_irq_enable(
- const sp_ID_t ID,
- const bool cnd)
+ const sp_ID_t ID,
+ const bool cnd)
{
if (cnd) {
sp_ctrl_setbit(ID, SP_IRQ_READY_REG, SP_IRQ_READY_BIT);
diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.c
index 54789d28a..469213a06 100644
--- a/drivers/staging/media/atomisp/pci/isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.c
+++ b/drivers/staging/media/atomisp/pci/isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.c
@@ -13,8 +13,8 @@
/* keep the interface here, it is not enabled yet because host doesn't know the size of individual state */
void
ia_css_init_cnr_state(
- void/*struct sh_css_isp_cnr_vmem_state*/ * state,
- size_t size)
+ void/*struct sh_css_isp_cnr_vmem_state*/ * state,
+ size_t size)
{
memset(state, 0, size);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
2026-06-22 18:49 [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces Batu Ada Tutkun
@ 2026-06-22 18:54 ` Batu Ada Tutkun
0 siblings, 0 replies; 9+ messages in thread
From: Batu Ada Tutkun @ 2026-06-22 18:54 UTC (permalink / raw)
To: linux-staging; +Cc: hansg, gregkh, linux-media, Batu Ada Tutkun
I missed Shirin Kaul's earlier patch [1] which already fixes sp.c as part
of a broader cleanup of hive_isp_css_common/host. Please disregard this patch.
[1] https://lore.kernel.org/linux-staging/20260505193015.49262-1-shirin.kaul11@gmail.com/
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-06-22 18:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11 0:55 [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces Michael Ugrin
2026-04-11 10:51 ` Dan Carpenter
2026-04-11 14:42 ` David Laight
2026-04-11 17:13 ` Michael Ugrin
2026-04-13 7:24 ` Andy Shevchenko
2026-04-11 17:34 ` [PATCH v2] staging: media: atomisp: use umin() for strscpy size arguments Michael Ugrin
2026-04-13 7:01 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2026-06-22 18:49 [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces Batu Ada Tutkun
2026-06-22 18:54 ` Batu Ada Tutkun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox