Return-path: Received: from 212.199.104.198.static.012.net.il ([212.199.104.198]:34851 "EHLO qualcomm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752260Ab2KRPow (ORCPT ); Sun, 18 Nov 2012 10:44:52 -0500 From: Vladimir Kondratiev To: Joe Perches Cc: "John W . Linville" , Johannes Berg , Andrew Morton , linux-wireless@vger.kernel.org, "Luis R . Rodriguez" , Jason Baron , Jim Cromie , Greg KH , LKML Subject: Re: [RFC] dynamic_debug: introduce debug_hex_dump() Date: Sun, 18 Nov 2012 17:43:07 +0200 Message-ID: <1380367.3QOKJVXxFC@lx-vladimir> (sfid-20121118_164514_258515_B5C1FE82) In-Reply-To: <1353249531.15959.10.camel@joe-AO722> References: <1352895463-22851-1-git-send-email-qca_vkondrat@qca.qualcomm.com> <3304277.iqgq3GH3Yo@lx-vladimir> <1353249531.15959.10.camel@joe-AO722> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linux-wireless-owner@vger.kernel.org List-ID: On Sunday, November 18, 2012 06:38:51 AM Joe Perches wrote: > Another option could be testing __builtin_constant_p(prefix) You mean something like below? Yes, it will work as well. Pro: don't need to change existing code (drop [PATCH 2/2] dynamic_debug: use constant format in print_hex_dump_bytes()) Cons: format in dynamic metadata will be useless What looks better? --- #define dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ groupsize, buf, len, ascii) \ do { \ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, \ __builtin_constant_p(prefix_str) ? prefix_str : "hexdump");\ if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ print_hex_dump(KERN_DEBUG, prefix_str, \ prefix_type, rowsize, groupsize, \ buf, len, ascii); \ } while (0)