From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753987AbcGaSFB (ORCPT ); Sun, 31 Jul 2016 14:05:01 -0400 Received: from smtprelay0220.hostedemail.com ([216.40.44.220]:49066 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753775AbcGaSFA (ORCPT ); Sun, 31 Jul 2016 14:05:00 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:69:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2110:2393:2559:2562:2828:2902:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3870:3871:3872:3873:3874:4321:4470:5007:7875:8603:10004:10400:10450:10455:10848:11232:11658:11783:11914:12043:12291:12296:12517:12519:12555:12663:12683:12740:13069:13071:13311:13357:13439:13894:14110:14180:14659:14721:19904:19999:21067:21080:21433:21434:21451:30012:30054:30070:30075:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: stop51_2627c86ce192c X-Filterd-Recvd-Size: 2446 Message-ID: <1469988260.3998.128.camel@perches.com> Subject: Re: [PATCH] qed: Add and use specific logging functions to reduce object size From: Joe Perches To: Yuval Mintz , Ariel Elior , Dept-Eng Everest Linux L2 Cc: linux-kernel , netdev Date: Sun, 31 Jul 2016 11:04:20 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-07-27 at 07:24 +0000, Yuval Mintz wrote: > > > > Current DP_ macros generate a lot of code. > > Using functions with vsprintf extension %pV helps reduce that size. > > > >  drivers/net/ethernet/qlogic/qed/Makefile   |  2 +- > >  drivers/net/ethernet/qlogic/qed/qed_util.c | 82 ++++++++++++++++++++++++++++++ > >  include/linux/qed/qed_if.h                 | 60 +++++++++------------- > >  3 files changed, 106 insertions(+), 38 deletions(-)  create mode 100644 > > drivers/net/ethernet/qlogic/qed/qed_util.c > This won't compile when CONFIG_QED*=m, as qede can't link to > the new qed_{err, verbose, info, notice} functions. > That was the original reason for putting the macros in the interface > header. > > Other alternatives: > - We can EXPORT_SYMBOL() the functions, although we've taken a > strain not adding such to the interface. >  - Code duplication between qed/qede [ugly]. >  - Implementing this in qede via the interface functions with qed;  > But the notion of defining an interface between 2 modules passing > va_args seems [to me] like a bad one. > > If you have cleaner solutions, I'd be happy to hear those. Hello Yuval. EXPORT_SYMBOL is probably the simplest solution. It's pretty commonly used for private logging functions in drivers/net/, e.g.: drivers/net/wireless/ath/main.c I'll submit that in awhile. cheers, Joe