From: Pavel Skripkin <paskripkin@gmail.com>
To: Guo Zhengkui <guozhengkui@vivo.com>,
Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Michael Straube <straube.linux@gmail.com>,
"open list:STAGING SUBSYSTEM" <linux-staging@lists.linux.dev>,
open list <linux-kernel@vger.kernel.org>
Cc: kernel@vivo.com
Subject: Re: [PATCH] staging: r8188eu: fix array_size.cocci warning
Date: Tue, 16 Nov 2021 09:54:52 +0300 [thread overview]
Message-ID: <39236708-f668-e99e-e749-6b7b863241a8@gmail.com> (raw)
In-Reply-To: <20211116064124.8833-1-guozhengkui@vivo.com>
On 11/16/21 09:41, Guo Zhengkui wrote:
> diff --git a/drivers/staging/r8188eu/core/rtw_rf.c b/drivers/staging/r8188eu/core/rtw_rf.c
> index 2ec56012516e..e704092d31d0 100644
> --- a/drivers/staging/r8188eu/core/rtw_rf.c
> +++ b/drivers/staging/r8188eu/core/rtw_rf.c
> @@ -35,7 +35,7 @@ static struct ch_freq ch_freq_map[] = {
> {216, 5080},/* Japan, means J16 */
> };
>
> -static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
> +static int ch_freq_map_num = ARRAY_SIZE(ch_freq_map);
>
> u32 rtw_ch2freq(u32 channel)
> {
>
Hm, do we need this variable to be static? It's used only in 2
expressions in rtw_ch2freq() (and 2nd one can be removed by
per-initializing freq with 2412).
I think, it can be places on stack to reduce binary size.
With regards,
Pavel Skripkin
prev parent reply other threads:[~2021-11-16 6:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 6:41 Guo Zhengkui
2021-11-16 6:41 ` Guo Zhengkui
2021-11-16 6:54 ` Pavel Skripkin [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=39236708-f668-e99e-e749-6b7b863241a8@gmail.com \
--to=paskripkin@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=guozhengkui@vivo.com \
--cc=kernel@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/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®