From: Joe Perches <joe@perches.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Justin Stitt <justinstitt@google.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Stephen Boyd <swboyd@chromium.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3] iio: sx9324: avoid copying property strings
Date: Sun, 17 Dec 2023 05:41:12 -0800 [thread overview]
Message-ID: <9a9e84bf64fc95840ff852aeb276ef8f724b60be.camel@perches.com> (raw)
In-Reply-To: <20231217132447.269072df@jic23-huawei>
On Sun, 2023-12-17 at 13:24 +0000, Jonathan Cameron wrote:
> On Mon, 11 Dec 2023 22:30:12 -0800
> Joe Perches <joe@perches.com> wrote:
>
> > On Tue, 2023-12-12 at 00:42 +0000, Justin Stitt wrote:
> > > We're doing some needless string copies when trying to assign the proper
> > > `prop` string. We can make `prop` a const char* and simply assign to
> > > string literals.
> >
> > trivia:
> >
> > I would have updated it like this moving the
> > various declarations into the case blocks
> > where they are used and removing a few unused
> > #defines
>
> I'd definitely like to see those defines gone.
> Arguably an unrelated change as I guess they are left from a previous refactor
> of this code.
>
> Why prop to type renaming?
random, no specific need, though I prefer not reusing
identifiers with different types in separate local scopes.
> It's getting passed into calls where the parameter
> is propname so I'd understand renaming to that, but type just seems a bit random
> to me. I do wonder if we are better off having some long lines and getting rid
> of the property naming local variables completely by just duplicating
> the device_property_read_u32() call and passing them in directly.
maybe, give it a try and see what you think.
next prev parent reply other threads:[~2023-12-17 13:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-12 0:42 [PATCH v3] iio: sx9324: avoid copying property strings Justin Stitt
2023-12-12 6:30 ` Joe Perches
2023-12-17 13:24 ` Jonathan Cameron
2023-12-17 13:41 ` Joe Perches [this message]
2023-12-12 21:26 ` Kees Cook
2023-12-14 0:59 ` Stephen Boyd
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=9a9e84bf64fc95840ff852aeb276ef8f724b60be.camel@perches.com \
--to=joe@perches.com \
--cc=jic23@kernel.org \
--cc=justinstitt@google.com \
--cc=lars@metafoo.de \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swboyd@chromium.org \
/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