From: Jarkko Nikula Subject: Re: dev_info() argument in sound/soc/soc_dapm.c Date: Wed, 22 Dec 2010 16:42:01 +0200 Message-ID: <20101222164201.8108ac05.jhnikula@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bw0-f42.google.com (mail-bw0-f42.google.com [209.85.214.42]) by alsa0.perex.cz (Postfix) with ESMTP id 4BB0B103AF3 for ; Wed, 22 Dec 2010 15:42:21 +0100 (CET) Received: by bwz13 with SMTP id 13so5959273bwz.29 for ; Wed, 22 Dec 2010 06:42:20 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood List-Id: alsa-devel@alsa-project.org On Wed, 22 Dec 2010 15:06:44 +0100 Takashi Iwai wrote: > Hi, > > my build tests caught a warning regarding the conversion to dev_info() > in soc-dapm.c. dev_info() is printf style, thus you shouldn't pass > the expanded string to the format argument. > > I applied the following patch to topic/asoc branch. > ... > --- a/sound/soc/soc-dapm.c > +++ b/sound/soc/soc-dapm.c > @@ -110,7 +110,7 @@ static void pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...) > > va_start(args, fmt); > vsnprintf(buf, PAGE_SIZE, fmt, args); > - dev_info(dev, buf); > + dev_info(dev, "%s", buf); > va_end(args); > Thanks! I guess this is safer as the buf here should contain only the characters to be printed. -- Jarkko