All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Elizabeth Ferdman <gnudevliz@gmail.com>
Cc: outreachy-kernel@googlegroups.com, gregkh@linuxfoundation.org
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8188eu: core: constify local structure
Date: Mon, 17 Oct 2016 11:26:11 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1610171124120.1921@hadrien> (raw)
In-Reply-To: <20161017064620.GA21653@localhost>



On Sun, 16 Oct 2016, Elizabeth Ferdman wrote:

> Constify the static struct RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.
>
> The only other instance was one of its properties being assigned to a
> variable:
> Index2G = RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.Index2G;
>
> Therefore this is a good candidate for constification.
>
> Running size did not show any difference:
> Before/After:
> text    data     bss     dec     hex filename
> 44122     408    2974   47504    b990

This is not a good sign.  It suggests that you have not actually compiled
the lines of code that you changed.

It is a little bit strange that a structure is declared to only contain
the number 3.

I wonder if something else is going on?

julia

>
> Lastly, break up the long line to fix the checkpatch warning and conform
> to kernel coding style.
>
> Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> index fb13df5..c94700c 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> @@ -133,7 +133,9 @@ static struct rt_channel_plan_map	RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
>  	{0x03},	/* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */
>  };
>
> -static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; /* use the combination for max channel numbers */
> +static const struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {
> +	0x03
> +}; /* use the combination for max channel numbers */
>
>  /*
>   * Search the @param channel_num in given @param channel_set
> --
> 2.1.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20161017064620.GA21653%40localhost.
> For more options, visit https://groups.google.com/d/optout.
>


  reply	other threads:[~2016-10-17  9:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17  6:46 [PATCH] staging: rtl8188eu: core: constify local structure Elizabeth Ferdman
2016-10-17  9:26 ` Julia Lawall [this message]
2016-10-17 22:23   ` [Outreachy kernel] " Elizabeth Ferdman
2016-10-18  5:26     ` Julia Lawall
2016-10-19 22:55       ` Elizabeth Ferdman

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=alpine.DEB.2.20.1610171124120.1921@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=gnudevliz@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.