Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751629AbdGRScy (ORCPT ); Tue, 18 Jul 2017 14:32:54 -0400 Received: from smtprelay0143.hostedemail.com ([216.40.44.143]:59598 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751543AbdGRScx (ORCPT ); Tue, 18 Jul 2017 14:32:53 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2693:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4559:5007:6119:7903:8603:9025:9040:10004:10400:10848:11026:11232:11658:11783:11914:12043:12048:12296:12555:12740:12895:12986:13138:13161:13184:13229:13231:13439:13870:13894:14180:14181:14659:14721:21067:21080:21433:21451:21611:21627:30003:30012:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:1:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: toad81_7021b52a5b01e X-Filterd-Recvd-Size: 3951 Message-ID: <1500402768.25934.29.camel@perches.com> Subject: Re: [PATCH v1 00/25] lib, rtc: Print rtc_time via %pt[dt][rv] From: Joe Perches To: Andy Shevchenko , Rasmus Villemoes , Greg Kroah-Hartman , Andrew Morton , linux-kernel@vger.kernel.org, Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Cc: Mark Salyzyn Date: Tue, 18 Jul 2017 11:32:48 -0700 In-Reply-To: <1500400523.29303.92.camel@linux.intel.com> References: <20170608134811.60786-1-andriy.shevchenko@linux.intel.com> <1500400205.25934.27.camel@perches.com> <1500400523.29303.92.camel@linux.intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 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 Content-Length: 2712 Lines: 89 On Tue, 2017-07-18 at 20:55 +0300, Andy Shevchenko wrote: > On Tue, 2017-07-18 at 10:50 -0700, Joe Perches wrote: > > On Thu, 2017-06-08 at 16:47 +0300, Andy Shevchenko wrote: > > > Recently I have noticed too many users of struct rtc_time that > > > printing > > > its content field by field. > > > > > > In this series I introduce %pt[dt][rv] specifier to make life a bit > > > easier. > > > > Hey Andy. > > > > I just saw a patch with a printk for rtc time from Mark Salyzyn. > > https://lkml.org/lkml/2017/7/18/885 > > Same! > > > Any idea if you want to push this extension? > > Yes, just really lack of time for everything. > > I like the idea to make it conditional (config BLABLABLA). It will > address some comments about footprint for no users. Only one of the other %p extensions is conditional and that conditional is probably not too useful. I think the code size is relatively small and not particularly valuable for the additional complexity. For instance, all of the code that emits MAC and IP[46] addresses %pM and %pI variants is 2.5K. (x86 allnoconfig) There are lots more code size savings than that lying about. And auditing all the code that might emit a MAC address when CONFIG_NET is not set is probably not worth the effort for the size reduction. $ size lib/vsprintf.o* ???text ???data ????bss ????dec ????hex filename ? 12140 ??????4 ??????0 ??12144 ???2f70 lib/vsprintf.o.allnoconfig.new ? 14785 ??????4 ??????0 ??14789 ???39c5 lib/vsprintf.o.allnoconfig.old --- lib/vsprintf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 86c3385b9eb3..de95e78ca5f0 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -933,6 +933,7 @@ char *bitmap_list_string(char *buf, char *end, unsigned long *bitmap, return buf; } +#ifdef CONFIG_NET static noinline_for_stack char *mac_address_string(char *buf, char *end, u8 *addr, struct printf_spec spec, const char *fmt) @@ -1241,6 +1242,7 @@ char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa, return string(buf, end, ip4_addr, spec); } +#endif static noinline_for_stack char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, @@ -1741,6 +1743,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, default: return bitmap_string(buf, end, ptr, spec, fmt); } +#ifdef CONFIG_NET case 'M': /* Colon separated: 00:01:02:03:04:05 */ case 'm': /* Contiguous: 000102030405 */ /* [mM]F (FDDI) */ @@ -1777,6 +1780,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, }} } break; +#endif case 'E': return escaped_string(buf, end, ptr, spec, fmt); case 'U':