From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755372AbcFQI0t (ORCPT ); Fri, 17 Jun 2016 04:26:49 -0400 Received: from sauhun.de ([89.238.76.85]:47009 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753171AbcFQI0q (ORCPT ); Fri, 17 Jun 2016 04:26:46 -0400 Date: Fri, 17 Jun 2016 10:26:38 +0200 From: Wolfram Sang To: Arnd Bergmann Cc: Greg Kroah-Hartman , Wolfram Sang , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: ks7010: honor 'const' qualifier Message-ID: <20160617082638.GB1406@tetsubishi> References: <20160615215330.37276-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kORqDWCi7qDJ0mEj" Content-Disposition: inline In-Reply-To: <20160615215330.37276-1-arnd@arndb.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --kORqDWCi7qDJ0mEj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 15, 2016 at 11:53:11PM +0200, Arnd Bergmann wrote: > The recently-added ks7010 driver produces an annoying build warning: >=20 > 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=3Ddiscarded-qualifiers] >=20 > 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. >=20 > 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 compar= es > against the end pointer, rather than relying on zero-termination. >=20 > This patch therefore removes the modification of the const data and marks > all the pointers 'const to avoid the warning. >=20 > Signed-off-by: Arnd Bergmann Thanks! I'll send in a second a patch, though, which removes the config file handling completely. Wolfram --kORqDWCi7qDJ0mEj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXY7Q+AAoJEBQN5MwUoCm2XBsP+wTWE62Vhm/TNv6doJsgurcc PdAzedWLHhQjOUnZvsYGdFu/R3h+FVoEVFn5WGWvLmdsAJleLIGn47bFWEdQda2C k83xwzB30HRbUgQUaGwnCEXNKcK9uVkodqgvYFKTB9vY0M5d1iCLGtR6SgY0xaW9 +ChgHGsXtR1Y2VqH863ZUveiak5+W84dCosqehdSM/NDr1lp4VOIEISTqWDbx6DT U2wf++z12tm2FSoXNNQRKUVoeeFk68S87FTKdgr4EDVzyvExxrGnaxssZkxzgvig 2ec279PFcbbp1ag5rOOPNKWcG5QiTsMcOEZFJjUNe7Rev9APlmiM0puQaXr68H9m FM5XxByA5gITZTWdYGm5CIlJEW0UbdcrydjQKeNreQT6NkrNS4OOIkMer+b48gMv HIdcZUuFLaPJsKO816ySEl5m9yuR3KdHKzhjg1OWLcOFCNqFDCXF+0gg8v94wmXI ZrhXogQMd8U4Wu7hrMK/efQdFVwqdoHnPtbkcdNFL4WDdmBczhBUqKgO21pIWolQ XIM5r5Z8pfgdIgbXQyNGTRpt2R5uECnLlVe0F1DPJ/Czh7GrZO5v5oxsUCWvUD9C huqTFWIU7sLnlJ0VERimIcbh2txxDJtaOUoMXccbFgpWTxotSOmJkQLmAzbgCX+l rltZc70i9wibCBFfHzjo =EgSH -----END PGP SIGNATURE----- --kORqDWCi7qDJ0mEj--