Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1424827

Re: [PATCH] staging: ks7010: honor 'const' qualifier

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: ks7010: honor 'const' qualifier
Date 2016-06-17 11:00 +0200
Message-ID <rKXN8-4gB-21@gated-at.bofh.it> (permalink)
References <rKr0R-80K-23@gated-at.bofh.it> <rKXk5-46B-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Friday, June 17, 2016 10:26:38 AM CEST Wolfram Sang wrote:
> On Wed, Jun 15, 2016 at 11:53:11PM +0200, Arnd Bergmann wrote:
> > The recently-added ks7010 driver produces an annoying build warning:
> > 
> > drivers/staging/ks7010/ks7010_config.c: In function 'ks_wlan_read_config_file':
> > drivers/staging/ks7010/ks7010_config.c:263:8: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> > 
> > The problem here is that it assigns the firmware data to a non-const
> > variable, and then goes on to modify it, which is clearly not the intended
> > use case.
> > 
> > The only modification is to set the last byte to '\0', and as far as
> > I can tell, this modification is unnecessary, as the parser always compares
> > against the end pointer, rather than relying on zero-termination.
> > 
> > This patch therefore removes the modification of the const data and marks
> > all the pointers 'const to avoid the warning.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Thanks! I'll send in a second a patch, though, which removes the config
> file handling completely.

Ok, perfect!

	Arnd

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] staging: ks7010: honor 'const' qualifier Arnd Bergmann <arnd@arndb.de> - 2016-06-16 00:00 +0200
  Re: [PATCH] staging: ks7010: honor 'const' qualifier Wolfram Sang <wsa@the-dreams.de> - 2016-06-17 10:30 +0200
    Re: [PATCH] staging: ks7010: honor 'const' qualifier Arnd Bergmann <arnd@arndb.de> - 2016-06-17 11:00 +0200

csiph-web