From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays Date: Wed, 21 Jun 2023 14:16:55 +0300 Message-ID: <87o7l92hg8.fsf@intel.com> References: <20230621091000.424843-1-j.granados@samsung.com> <20230621094817.433842-1-j.granados@samsung.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687346282; x=1718882282; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=bNOOeYVCQ7poh+/POpUoy8h5Fc7oKKTV5NlBm31y8T8=; b=UwWPAw+/N37hMw7X+nGZKpKlbKMwdZwvU+RQSpoKtcCgHwAHlhG1R0Bz mdQuYCMMNAaFMEkH7GrE4t3WUk2LY/5Pcnf2XGALDNK9RwMDVImCbKHMg qoOzDu8Gcpxdq/rZVd9n7TljpxDRVX4QNw/YfVDT6F30txm34vFMxXfrb KOm3AeOH23cSslUWfXulopUv1Ymrabi373RGtL5NwNXUaKveRfwRjWum2 5UHnjpMjtR78BKPbQg5XHQQBYzvRvOHoG3xnfMxW2NmjyCJbH96j0tEg6 nOjpaqQe/fp4wEK6ZzsCO4YL+JCONvGwpYn8qdpKeL2Pwdr9aQXiY+jDK Q==; In-Reply-To: <20230621094817.433842-1-j.granados@samsung.com> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Joel Granados , mcgrof@kernel.org, Russell King , Catalin Marinas , Will Deacon , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Gerald Schaefer , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Herbert Xu , "David S. Miller" , Russ Weight , Greg Kroah-Hartman , Phillip Potter <> Cc: Joel Granados , Nicholas Piggin , Christophe Leroy , Christian Borntraeger , Sven Schnelle , "H. Peter Anvin" , "Rafael J. Wysocki" , Mike Travis , Oleksandr Tyshchenko , Amir Goldstein , Matthew Bobrowski , John Fastabend , Martin KaFai Lau , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Waiman Long , Boqun Feng On Wed, 21 Jun 2023, Joel Granados 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. > 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. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center