lkml.org 
[lkml]   [2023]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] iio: sx9324: avoid copying property strings
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

On Mon, Dec 11, 2023 at 4:46 PM Justin Stitt <justinstitt@google.com> wrote:
>
> 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

\
 
 \ /
  Last update: 2023-12-13 00:52    [W:0.060 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site