From: Joel Granados <j.granados@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: mcgrof@kernel.org, Russell King <linux@armlinux.org.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Russ Weight <russell.h.weight@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Phillip Potter <phil@philpotter.co.uk>,
Clemens Ladisch <clemens@ladisch.de>,
Arnd Bergmann <arnd@arndb.de>, Corey Minyard <minyard@acm.org>,
Theodore Ts'o <tytso@mit.edu>,
Ja
Subject: Re: [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:06:14 +0200 [thread overview]
Message-ID: <20230621130614.s36w4u7dzmb5d5p3@localhost> (raw)
In-Reply-To: <87o7l92hg8.fsf@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3413 bytes --]
On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > Remove the empty end element from all the arrays that are passed to the
> > register sysctl calls. In some files this means reducing the explicit
> > array size by one. Also make sure that we are using the size in
> > ctl_table_header instead of evaluating the .procname element.
>
> Where's the harm in removing the end elements driver by driver? This is
> an unwieldy patch to handle.
I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
* I could for example separate all the removes into separate commits and
then have a final commit that removes the check for the empty element.
But this will leave the tree in a state where the for loop will have
undefined behavior when it looks for the empty end element. It might
or might not work (probably not :) until the final commit where I fix
that.
* I could also change the logic that looks for the final element,
commit that first and then remove the empty element one commit per
driver after that. But then for all the arrays that still have an
empty element, there would again be undefined behavior as it would
think that the last element is valid (when it is really the sentinel).
Any ideas on how to get around these?
>
> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> > index f43950219ffc..e4d7372afb10 100644
> > --- a/drivers/gpu/drm/i915/i915_perf.c
> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >
> > static struct ctl_table oa_table[] = {
> > {
> > - .procname = "perf_stream_paranoid",
> > - .data = &i915_perf_stream_paranoid,
> > - .maxlen = sizeof(i915_perf_stream_paranoid),
> > - .mode = 0644,
> > - .proc_handler = proc_dointvec_minmax,
> > - .extra1 = SYSCTL_ZERO,
> > - .extra2 = SYSCTL_ONE,
> > - },
> > + .procname = "perf_stream_paranoid",
> > + .data = &i915_perf_stream_paranoid,
> > + .maxlen = sizeof(i915_perf_stream_paranoid),
> > + .mode = 0644,
> > + .proc_handler = proc_dointvec_minmax,
> > + .extra1 = SYSCTL_ZERO,
> > + .extra2 = SYSCTL_ONE,
> > + },
> > {
> > - .procname = "oa_max_sample_rate",
> > - .data = &i915_oa_max_sample_rate,
> > - .maxlen = sizeof(i915_oa_max_sample_rate),
> > - .mode = 0644,
> > - .proc_handler = proc_dointvec_minmax,
> > - .extra1 = SYSCTL_ZERO,
> > - .extra2 = &oa_sample_rate_hard_limit,
> > - },
> > - {}
> > + .procname = "oa_max_sample_rate",
> > + .data = &i915_oa_max_sample_rate,
> > + .maxlen = sizeof(i915_oa_max_sample_rate),
> > + .mode = 0644,
> > + .proc_handler = proc_dointvec_minmax,
> > + .extra1 = SYSCTL_ZERO,
> > + .extra2 = &oa_sample_rate_hard_limit,
> > + }
> > };
>
> The existing indentation is off, but fixing it doesn't really belong in
> this patch.
Agreed. But I actually was trying to fix something that checkpatch
flagged. I'll change these back (which will cause this patch to be
flagged).
An alternative solution would be to fix the indentation as part of the
preparation patches. Tell me what you think.
Thx
>
> BR,
> Jani.
>
>
> --
> Jani Nikula, Intel Open Source Graphics Center
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2023-06-21 13:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230621091022eucas1p1c097da50842b23e902e1a674e117e1aa@eucas1p1.samsung.com>
[not found] ` <20230621091000.424843-1-j.granados@samsung.com>
2023-06-21 9:09 ` [PATCH 06/11] sysctl: Add size to register_net_sysctl function Joel Granados
2023-06-21 9:47 ` Dan Carpenter
2023-06-21 10:23 ` Dan Carpenter
2023-06-21 12:03 ` Joel Granados
2023-06-23 14:21 ` Joel Granados
2023-06-21 10:49 ` Dan Carpenter
2023-06-21 11:49 ` Joel Granados
2023-06-21 11:36 ` Joel Granados
2023-06-21 9:48 ` [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays Joel Granados
2023-06-21 11:16 ` Jani Nikula
2023-06-21 13:06 ` Joel Granados [this message]
2023-06-21 13:15 ` Jani Nikula
2023-06-21 13:43 ` Joel Granados
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=20230621130614.s36w4u7dzmb5d5p3@localhost \
--to=j.granados@samsung.com \
--cc=agordeev@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=clemens@ladisch.de \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=hca@linux.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=jani.nikula@linux.intel.com \
--cc=linux@armlinux.org.uk \
--cc=luto@kernel.org \
--cc=mcgrof@kernel.org \
--cc=mingo@redhat.com \
--cc=minyard@acm.org \
--cc=mpe@ellerman.id.au \
--cc=phil@philpotter.co.uk \
--cc=russell.h.weight@intel.com \
--cc=tglx@linutronix.de \
--cc=tytso@mit.edu \
--cc=will@kernel.org \
--cc=x86@kernel.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