lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 2 Mar 2018 08:39:28 -0600
From:   Corey Minyard <minyard@....org>
To:     Colin King <colin.king@...onical.com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        openipmi-developer@...ts.sourceforge.net
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ipmi: use ARRAY_SIZE for poweroff_functions array sizing
 calculation

On 03/02/2018 08:14 AM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> Use the ARRAY_SIZE macro on a array poweroff_functions to determine
> size of the array. Improvement suggested by Coccinelle.

Queued for next release.  Thanks!

-corey

> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>   drivers/char/ipmi/ipmi_poweroff.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c
> index 07fa366bc8f0..fccb1e9fd3b7 100644
> --- a/drivers/char/ipmi/ipmi_poweroff.c
> +++ b/drivers/char/ipmi/ipmi_poweroff.c
> @@ -519,8 +519,7 @@ static struct poweroff_function poweroff_functions[] = {
>   	  .detect		= ipmi_chassis_detect,
>   	  .poweroff_func	= ipmi_poweroff_chassis },
>   };
> -#define NUM_PO_FUNCS (sizeof(poweroff_functions) \
> -		      / sizeof(struct poweroff_function))
> +#define NUM_PO_FUNCS ARRAY_SIZE(poweroff_functions)
>   
>   
>   /* Called on a powerdown request. */


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ