From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756048Ab0CDWit (ORCPT ); Thu, 4 Mar 2010 17:38:49 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:53002 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561Ab0CDWir (ORCPT ); Thu, 4 Mar 2010 17:38:47 -0500 Date: Thu, 4 Mar 2010 14:38:37 -0800 From: Andrew Morton To: Joe Perches Cc: Linus Torvalds , Nick Andrew , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , netdev@vger.kernel.org Subject: Re: [RESEND PATCH 0/2] Make functions of dev_ macros, recursive vsnprintf Message-Id: <20100304143837.af39845d.akpm@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Mar 2010 22:27:21 -0800 Joe Perches wrote: > (Typo'ed Linus' email address, added Greg KH and netdev) What is the networking significance here? > dev_ macros use a lot of repetitive string space. > > Eliminate the string prefixes and function arguments from all the macro uses > and consolidate them in functions. > > This patchset saves about 60K. > > This implementation also adds the ability to use a struct va_format to > emit a format string along with va_list arguments. > > This %pV implementation should not be used without a wrapper that > does printf argument verification like the dev_ functions. > > Inspired a bit by Nick Andrew's patches and Linus' comments in December 2008 > http://lkml.org/lkml/2008/12/6/15 > http://lkml.org/lkml/2008/12/6/101 > Looks like a reasonable approach, although I didn't check how much additional stack the recursion will take. Bear in mind that printk() can be called from super-deep contexts. What would I need to do to make it recur more than once? Include a %pV in a string, like dev_printk("%s", %%pV")?