[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <db9a3df1947223f317198f383af6024fe5ee76f4.camel@perches.com>
Date: Thu, 04 Oct 2018 11:10:57 -0700
From: Joe Perches <joe@...ches.com>
To: Michael Straube <straube.linux@...il.com>,
gregkh@...uxfoundation.org
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] staging: rtl8188eu: cleanup array declaration -
style
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.
Powered by blists - more mailing lists