From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755346AbcFQIun (ORCPT ); Fri, 17 Jun 2016 04:50:43 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:53866 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbcFQIuj (ORCPT ); Fri, 17 Jun 2016 04:50:39 -0400 From: Arnd Bergmann To: Wolfram Sang Cc: Greg Kroah-Hartman , Wolfram Sang , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: ks7010: honor 'const' qualifier Date: Fri, 17 Jun 2016 10:52:17 +0200 Message-ID: <7953615.HK5rbY91TU@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-22-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20160617082638.GB1406@tetsubishi> References: <20160615215330.37276-1-arnd@arndb.de> <20160617082638.GB1406@tetsubishi> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:cAufyen05pMNYjclobRzQL3dMzNFC8gcwdcJdflTqRRqZhgA/cv Gqtu4Fw4lYhw8m3He4E7SvT6kKYJKscf1JY1keE8uxlDxCUweVc9knYUUXBfaNVja9HeLfT mwDZ4qvVqnWwUkL2XyG7/03rYizpDGvz0sPxKX1zxBh+zkMq4vVzib+q3fdernh5/B4r+He Wux/iyglZs5xweF/da3PA== X-UI-Out-Filterresults: notjunk:1;V01:K0:VEGfy5uyZ+w=:+4ejXFNLZ3rLXi3m5oDrtL jIUqPRw/hui4m6DPEROiHRGcScw5eMRF2empZO+n3V2ea/w1lLuUUJM3sZ90rzonpLD6A01Ag WQOScs3fpOcFmSYqB+Oad+cMAG5URM9KcOOtPH8bbhO71LW2ZJ6/BuxpSL2Qdc27+ZdvRrbBC sPfUkzRBpPDxxdR6Ep1R0Z8yLHbJLleAnXn0+P0qK0yN9zn9mPui+Ga2vgpbhv5nzy4BTU9bX kIIzOtWUkORs8Q/DBPCffxWk7jT674e5ErPvKou3Er1E0gg6XJxQosFlyGwpUkBTeu4/yxabm d+TSKtMjKFSLJtvmK5P0zDN9LkUBHJZ3BRc5WKbZCd9R9aYtnNDlLqDRasc+FCnyJWL/nEHDX +3TABb2vixdbn2V3FRz0AqUSEXc+D0PaSpQA9UAvb7aAS11eg02jbYzs1NhZA3nlYNpq+BNP+ VAedscNGNciwVKRvIfG4tRPPQIlZsS1eWLq72c1kwuV4WGgoBv3JjgvNaJrAUEKBU8ED+7M2y IeEnx0oe3wqP5KYCQE+JXFdQ2GOUR2LqBO44R6q33wIF7CWuSXQNEsRXTTVfmCmMznjhROGbK MGTt4GkFwbqldZG9i+sBRXSqaw0yS0rGJsg+bmPQJHAY4DrKd6jSHxuNpVkZbwMJZJpG8G1pD 9zB1gojbkID9FVA3r7SdBXl/k15k65uW6sfFY55o/xZ0RQ6GjIwTH8ddSOuMgtwtdS2HfGuQy vj9ha4pmT+pw2TiD Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Thanks! I'll send in a second a patch, though, which removes the config > file handling completely. Ok, perfect! Arnd