From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756567AbZHZATI (ORCPT ); Tue, 25 Aug 2009 20:19:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756067AbZHZATH (ORCPT ); Tue, 25 Aug 2009 20:19:07 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:48697 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbZHZATF (ORCPT ); Tue, 25 Aug 2009 20:19:05 -0400 Date: Tue, 25 Aug 2009 17:18:28 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Anirban Sinha cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] console_print: change the function api to make it have printk style interface In-Reply-To: Message-ID: References: User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 Aug 2009, Anirban Sinha wrote: > > -void console_print(const char *s) > +int console_print(const char *fmt, ...) > { > - printk(KERN_EMERG "%s", s); > + va_list args; > + int r; > + char _fmt[1024] = KERN_EMERG; Don't do this. That's a 1kB stack frame right there. You'll overflow the stack very quickly. Linus