From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752079AbdBHVXE (ORCPT ); Wed, 8 Feb 2017 16:23:04 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:35625 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235AbdBHVXB (ORCPT ); Wed, 8 Feb 2017 16:23:01 -0500 Date: Wed, 8 Feb 2017 13:16:49 -0800 From: Brian Norris To: Marek Vasut Cc: Arnd Bergmann , David Woodhouse , Boris Brezillon , Richard Weinberger , Cyrille Pitchen , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy Message-ID: <20170208211649.GE94627@google.com> References: <20170203094946.2112158-1-arnd@arndb.de> <0e6b1dc1-5311-91ba-10e3-1a13f866df6b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0e6b1dc1-5311-91ba-10e3-1a13f866df6b@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 04, 2017 at 10:12:35PM +0100, Marek Vasut wrote: > On 02/03/2017 10:49 AM, Arnd Bergmann wrote: > > kernelci.org reports a warning for this driver, as it copies a local > > variable into a 'const char *' string: > > > > drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] > > > > Using kstrndup() simplifies the code and avoids the warning. > > > > Signed-off-by: Arnd Bergmann > > Acked-by: Marek Vasut Applied to l2-mtd.git.