Re: [PATCH 08/11] sysctl: Add size to register_sysctl_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 21, 2023 at 12:47:58PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 21, 2023 at 11:09:57AM +0200, Joel Granados wrote:
> >  static int __init random_sysctls_init(void)
> >  {
> > -	register_sysctl_init("kernel/random", random_table);
> > +	register_sysctl_init("kernel/random", random_table,
> > +			     ARRAY_SIZE(random_table));
> 
> As mentioned before, why not just do:
> 
> #define register_sysctl_init(string, table)	\
> 	__register_sysctl_init(string, table, ARRAY_SIZE(table);
Answered you in the original mail where you suggested it.

Best
> 
> or something like that?
> 
> That way no callers need to change AND you prevent the size from ever
> being incorrect?
> 
> thanks,
> 
> greg k-h

-- 

Joel Granados

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux