From: Corey Minyard <minyard@acm.org>
To: Colin King <colin.king@canonical.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
openipmi-developer@lists.sourceforge.net
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipmi: use ARRAY_SIZE for poweroff_functions array sizing calculation
Date: Fri, 2 Mar 2018 08:39:28 -0600 [thread overview]
Message-ID: <73ab71b3-a2dd-1aa9-4c4c-57b761c6cdab@acm.org> (raw)
In-Reply-To: <20180302141451.656-1-colin.king@canonical.com>
On 03/02/2018 08:14 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.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@canonical.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. */
prev parent reply other threads:[~2018-03-02 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-02 14:14 Colin King
2018-03-02 14:39 ` Corey Minyard [this message]
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=73ab71b3-a2dd-1aa9-4c4c-57b761c6cdab@acm.org \
--to=minyard@acm.org \
--cc=arnd@arndb.de \
--cc=colin.king@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®