From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752268AbbCYLDb (ORCPT ); Wed, 25 Mar 2015 07:03:31 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:51055 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbbCYLD3 (ORCPT ); Wed, 25 Mar 2015 07:03:29 -0400 Date: Wed, 25 Mar 2015 11:03:27 +0000 From: Charles Keepax To: Takashi Iwai Cc: broonie@kernel.org, alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com, nikesh@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: Re: [alsa-devel] [PATCH] ASoC: DAPM: Fix build warning Message-ID: <20150325110327.GN23705@opensource.wolfsonmicro.com> References: <1427278408-27134-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2015 at 11:53:30AM +0100, Takashi Iwai wrote: > At Wed, 25 Mar 2015 10:13:28 +0000, > Charles Keepax wrote: > > > > commit c66150824b8a ("ASoC: dapm: add code to configure dai link > > parameters") introduced the following build warning: > > > > sound/soc/soc-dapm.c: In function 'snd_soc_dapm_new_pcm': > > sound/soc/soc-dapm.c:3389:4: warning: passing argument 1 of 'snprintf' > > discards 'const' qualifier from pointer target type > > snprintf(w_param_text[count], len, > > > > This patch fixes this by adding a non-const temporary variable to hold > > the value as it is created before assigning to the entry in > > w_param_text. > > > > Signed-off-by: Charles Keepax > > An easier fix would be to replace with devm_kasprintf(). Then you can > do it all in a single line. > > w_param_text[count] = devm_kasprintf(card->dev, GFP_KERNEL, > "Anonymous Configuration %d", count); > > > Takashi Thanks wasn't aware of that one, I will respin. Thanks, Charles