]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
csky: Remove the size from alignment_tbl declaration
authorJoel Granados <joel.granados@kernel.org>
Fri, 31 Jan 2025 13:10:57 +0000 (14:10 +0100)
committerJoel Granados <joel.granados@kernel.org>
Wed, 5 Feb 2025 09:15:40 +0000 (10:15 +0100)
Having to synchronize the number of ctl_table array elements with the
size in the declaration can lead to discrepancies between the two
values. Since commit d7a76ec87195 ("sysctl: Remove check for sentinel
element in ctl_table arrays"), the calculation of the ctl_table array
size is done solely by the ARRAY_SIZE macro removing the need for the
size in the declaration.

Remove the size for the aligment_tbl declaration and const qualify the
array for good measure.

Signed-off-by: Joel Granados <joel.granados@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
arch/csky/abiv1/alignment.c

index e5b8b4b2109aceaaccc2db0b03877e30280f8435..aee904833deced8d84312c145f8d599d5bdc0467 100644 (file)
@@ -300,7 +300,7 @@ bad_area:
        force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr);
 }
 
-static struct ctl_table alignment_tbl[5] = {
+static const struct ctl_table alignment_tbl[] = {
        {
                .procname = "kernel_enable",
                .data = &align_kern_enable,