All of lore.kernel.org
 help / color / mirror / Atom feed
From: Justin Stitt <justinstitt@google.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org,
	Gwendal Grignou <gwendal@chromium.org>
Subject: Re: [PATCH v2] iio: sx9324: avoid copying property strings
Date: Mon, 11 Dec 2023 16:46:20 -0800	[thread overview]
Message-ID: <CAFhGd8p76R-oaPWR0G6wESe7kgM--2bzU88j2vz4QGy8wKNffg@mail.gmail.com> (raw)
In-Reply-To: <CAE-0n51eAH1tcqXVeReavq0US-Th2qwC_s_uAzRKTpSG-kXuwA@mail.gmail.com>

Hi,

On Mon, Oct 30, 2023 at 2:44 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
>
> We need to free it in other places too, like if the count doesn't match.
> It may be easier to extract this section and just have 4 string
> literals.
>
>         switch (reg_def->reg) {
>         case SX9324_REG_AFE_PH0:
>                 reg_def = sx9324_parse_phase_prop(dev, reg_def, "semtech,ph0-pin");
>                 break;
>         case SX9324_REG_AFE_PH1:
>                 reg_def = sx9324_parse_phase_prop(dev, reg_def, "semtech,ph1-pin");
>                 break;
>         case SX9324_REG_AFE_PH2:
>                 reg_def = sx9324_parse_phase_prop(dev, reg_def, "semtech,ph2-pin");
>                 break;
>         case SX9324_REG_AFE_PH3:
>                 reg_def = sx9324_parse_phase_prop(dev, reg_def, "semtech,ph3-pin");
>                 break;
>

I've submitted v3 of this patch [1] trying out Stephen's idea. I'd
appreciate feedback.

[1]: https://lore.kernel.org/all/20231212-strncpy-drivers-iio-proximity-sx9324-c-v3-1-b8ae12fc8a5d@google.com/

Thanks
Justin

  reply	other threads:[~2023-12-12  0:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 23:53 [PATCH v2] iio: sx9324: avoid copying property strings Justin Stitt
2023-10-27 16:18 ` Kees Cook
2023-10-28 15:26 ` Jonathan Cameron
2023-10-30 21:44   ` Stephen Boyd
2023-12-12  0:46     ` Justin Stitt [this message]
2023-12-12 23:51       ` Gwendal Grignou
2023-12-17 13:00         ` Jonathan Cameron

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=CAFhGd8p76R-oaPWR0G6wESe7kgM--2bzU88j2vz4QGy8wKNffg@mail.gmail.com \
    --to=justinstitt@google.com \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.