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

Wolfram Sang wsa at the-dreams.de
Fri Jun 17 08:26:38 UTC 2016


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 at arndb.de>

Thanks! I'll send in a second a patch, though, which removes the config
file handling completely.

   Wolfram

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20160617/e4647879/attachment.asc>


More information about the devel mailing list