From: David Laight <david.laight.linux@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Michael Ugrin <mugrinphoto@gmail.com>,
hansg@kernel.org, mchehab@kernel.org,
sakari.ailus@linux.intel.com, andy@kernel.org,
gregkh@linuxfoundation.org, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: media: atomisp: fix indentation to use tabs instead of spaces
Date: Sat, 11 Apr 2026 15:42:23 +0100 [thread overview]
Message-ID: <20260411154223.3091eb45@pumpkin> (raw)
In-Reply-To: <adont11Sr92pi0_N@stanley.mountain>
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
>
>
next prev parent reply other threads:[~2026-04-11 14:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-04-11 17:13 ` Michael Ugrin
2026-04-11 17:34 ` [PATCH v2] staging: media: atomisp: use umin() for strscpy size arguments Michael Ugrin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260411154223.3091eb45@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=andy@kernel.org \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mugrinphoto@gmail.com \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox