From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754624Ab0IMUaO (ORCPT ); Mon, 13 Sep 2010 16:30:14 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36394 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794Ab0IMUaM (ORCPT ); Mon, 13 Sep 2010 16:30:12 -0400 Date: Mon, 13 Sep 2010 22:30:11 +0200 Message-ID: From: Takashi Iwai To: Joe Perches Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela , alsa-devel@alsa-project.org Subject: Re: [PATCH 24/25] sound: Use static const char arrays In-Reply-To: References: User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 13 Sep 2010 12:48:02 -0700, Joe Perches wrote: > > Signed-off-by: Joe Perches > --- > sound/core/misc.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/sound/core/misc.c b/sound/core/misc.c > index 2c41825..0e5e77f 100644 > --- a/sound/core/misc.c > +++ b/sound/core/misc.c > @@ -64,12 +64,15 @@ static int print_snd_pfx(unsigned int level, const char *path, int line, > const char *format) > { > const char *file = sanity_file_name(path); > - char tmp[] = "<0>"; > + char tmp[sizeof("<0>")]; > const char *pfx = level ? KERN_DEBUG : KERN_DEFAULT; > int ret = 0; > > if (format[0] == '<' && format[2] == '>') { > + tmp[0] = '<'; > tmp[1] = format[1]; > + tmp[2] = '>'; > + tmp[3] = 0; > pfx = tmp; > ret = 1; > } Would this case save something really...? thanks, Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 24/25] sound: Use static const char arrays Date: Mon, 13 Sep 2010 22:30:11 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 43C3310384E for ; Mon, 13 Sep 2010 22:30:12 +0200 (CEST) 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: Joe Perches Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org List-Id: alsa-devel@alsa-project.org At Mon, 13 Sep 2010 12:48:02 -0700, Joe Perches wrote: > > Signed-off-by: Joe Perches > --- > sound/core/misc.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/sound/core/misc.c b/sound/core/misc.c > index 2c41825..0e5e77f 100644 > --- a/sound/core/misc.c > +++ b/sound/core/misc.c > @@ -64,12 +64,15 @@ static int print_snd_pfx(unsigned int level, const char *path, int line, > const char *format) > { > const char *file = sanity_file_name(path); > - char tmp[] = "<0>"; > + char tmp[sizeof("<0>")]; > const char *pfx = level ? KERN_DEBUG : KERN_DEFAULT; > int ret = 0; > > if (format[0] == '<' && format[2] == '>') { > + tmp[0] = '<'; > tmp[1] = format[1]; > + tmp[2] = '>'; > + tmp[3] = 0; > pfx = tmp; > ret = 1; > } Would this case save something really...? thanks, Takashi