Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:55944 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755918Ab2KMWwu (ORCPT ); Tue, 13 Nov 2012 17:52:50 -0500 Date: Tue, 13 Nov 2012 14:52:48 -0800 From: Andrew Morton To: Joe Perches Cc: Vladimir Kondratiev , Jason Baron , "John W . Linville" , Johannes Berg , linux-wireless@vger.kernel.org, "Luis R . Rodriguez" Subject: Re: [PATCH v7 1/2] wireless: Driver for 60GHz card wil6210 Message-Id: <20121113145248.f617e67f.akpm@linux-foundation.org> (sfid-20121113_235253_386112_D6A7C948) In-Reply-To: <1352846384.17444.18.camel@joe-AO722> References: <1352809427-29682-1-git-send-email-qca_vkondrat@qca.qualcomm.com> <1352809427-29682-2-git-send-email-qca_vkondrat@qca.qualcomm.com> <1352811970.24230.22.camel@joe-AO722> <20121113134436.de5df090.akpm@linux-foundation.org> <1352846384.17444.18.camel@joe-AO722> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 13 Nov 2012 14:39:44 -0800 Joe Perches wrote: > On Tue, 2012-11-13 at 13:44 -0800, Andrew Morton wrote: > > On Tue, 13 Nov 2012 05:06:10 -0800 > > Joe Perches wrote: > > > > > On Tue, 2012-11-13 at 14:23 +0200, Vladimir Kondratiev wrote: > > > [] > > > > diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h > > > [] > > > > +/* Candidate to merge into printk.h and dynamic_debug.h */ > > > > +#if defined(CONFIG_DYNAMIC_DEBUG) > > > > +#define dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ > > > > + groupsize, buf, len, ascii) \ > > > > +do { \ > > > > + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, prefix_str); \ > > > > + if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ > > > > + print_hex_dump(KERN_DEBUG, prefix_str, \ > > > > + prefix_type, rowsize, groupsize, \ > > > > + buf, len, ascii); \ > > > > +} while (0) > > > > + > > > > +#define debug_hex_dump(prefix_str, prefix_type, rowsize, \ > > > > + groupsize, buf, len, ascii) \ > > > > + dynamic_hex_dump(prefix_str, prefix_type,\ > > > > + rowsize, groupsize, buf,\ > > > > + len, ascii) > > > > +#else > > > > +#define debug_hex_dump(prefix_str, prefix_type, rowsize, \ > > > > + groupsize, buf, len, ascii) \ > > > > + print_hex_dump(KERN_DEBUG, prefix_str, \ > > > > + prefix_type, rowsize, \ > > > > + groupsize, buf, len, ascii) > > > > +#endif > > > > > > Thanks Vladimir. I think so too. > > > > > > Jason? Andrew? > > > > (I'm not on linux-wireless) > > > > Agree that the above should be in a core header file. > > > > Disagree with placing it in a wireless header. > > > > Please split it out into a standalone patch. > > > > Does it have to be done as macros? Can't do at least some of > > this in C? > > Macros are required here because of CONFIG_DYNAMIC_DEBUG I don't see why? > It's how it's done currently for all dynamic_ uses. > > > Some interface documentation would be nice, especially if it's > > implemented in macros - that's an awful lot of arguments to have to > > guess about. > > kernel-doc should probably be added for all printk forms, > not just for this. These ones are pretty egregious but on reflection, they're just wrappers around print_hex_dump(), which is documented - there's no point in saying the same thing in two places.