All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Michael Straube <straube.linux@gmail.com>, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] staging: rtl8188eu: cleanup array declaration - style
Date: Thu, 04 Oct 2018 11:10:57 -0700	[thread overview]
Message-ID: <db9a3df1947223f317198f383af6024fe5ee76f4.camel@perches.com> (raw)
In-Reply-To: <e2c8ffb7-4c62-8da9-9f78-00edb4edcb5e@gmail.com>

On Thu, 2018-10-04 at 14:12 +0200, Michael Straube wrote:
> On 10/3/18 11:30 PM, Joe Perches wrote:
>    
> > >   static struct mlme_handler mlme_sta_tbl[] = {
> > 
> > Perhaps const here too, and as well, the struct
> > declaration could use const char * instead of char *
> > 
> 
> Making it const gives following warning.
> 
> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c: In function 'mgt_dispatcher':
> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4114:9: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>    ptable = mlme_sta_tbl;

No worries, then it's not appropriate to use const.

It's just most common for this sort of table to be const
but if this driver is reassigning values in the table,
then it can't be const.

It is possible though that the code might not be suitable
for multiple simultaneous instances of the device type.

Dunno.  I don't use it nor have I inspected the code.


  reply	other threads:[~2018-10-04 18:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 20:43 [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style Michael Straube
2018-10-03 20:43 ` [PATCH 2/3] staging: rtl8188eu: cleanup array declaration " Michael Straube
2018-10-03 21:30   ` Joe Perches
2018-10-04  8:20     ` Michael Straube
2018-10-04 12:12     ` Michael Straube
2018-10-04 18:10       ` Joe Perches [this message]
2018-10-03 20:43 ` [PATCH 3/3] staging: rtl8188eu: rewrite if tests " Michael Straube
2018-10-03 21:26 ` [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters " Joe Perches
2018-10-04 15:54   ` Michael Straube

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=db9a3df1947223f317198f383af6024fe5ee76f4.camel@perches.com \
    --to=joe@perches.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.