[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfcvNpdSP_XvbB42ZUxCik3v-jhR7WFjsaJVr3AZR=nJg@mail.gmail.com>
Date: Sat, 27 May 2023 10:22:13 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Bjorn Andersson <andersson@...nel.org>
Cc: Mukesh Ojha <quic_mojha@...cinc.com>, agross@...nel.org,
konrad.dybcio@...aro.org, linus.walleij@...aro.org,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org
Subject: Re: [PATCH v6 5/5] firmware: qcom_scm: Add multiple download mode support
On Sat, May 27, 2023 at 2:32 AM Bjorn Andersson <andersson@...nel.org> wrote:
> On Sat, May 27, 2023 at 01:14:50AM +0300, andy.shevchenko@...il.com wrote:
> > Wed, Mar 29, 2023 at 01:16:52PM +0530, Mukesh Ojha kirjoitti:
...
> > > if (download_mode == QCOM_DOWNLOAD_FULLDUMP)
> > > len = sysfs_emit(buffer, "full\n");
> > > + else if (download_mode == QCOM_DOWNLOAD_MINIDUMP)
> > > + len = sysfs_emit(buffer, "mini\n");
> > > + else if (download_mode == QCOM_DOWNLOAD_BOTHDUMP)
> >
> > > + len = sysfs_emit(buffer, "full,mini\n");
> >
> > Why not "both" ?
> "both" isn't very future proof (and I think we've had additional
> variations in the past already), so I asked for this form.
Okay, so this should be the bit flags and we should parse a list of
the values. In that case I may agree with the approach.
> > if (mode >= ARRAY_SIZE(...))
> > return sysfs_emit("Oh heh!\n");
> >
> > return sysfs_emit("%s\n", array[mode]);
...
> > > + if (sysfs_streq(val, "full,mini") || sysfs_streq(val, "mini,full")) {
> > > + download_mode = QCOM_DOWNLOAD_BOTHDUMP;
> >
> > It's way too hard, esp. taking into account that once user enters wrong order,
> > user can't simply validate this by reading value back.
> >
> > Use "both" and that's it.
> >
> > > + } else if (sysfs_streq(val, "full")) {
> > > download_mode = QCOM_DOWNLOAD_FULLDUMP;
> > > + } else if (sysfs_streq(val, "mini")) {
> > > + download_mode = QCOM_DOWNLOAD_MINIDUMP;
As per above.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists