From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbbIJPld (ORCPT ); Thu, 10 Sep 2015 11:41:33 -0400 Received: from smtprelay0121.hostedemail.com ([216.40.44.121]:53289 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751323AbbIJPl2 (ORCPT ); Thu, 10 Sep 2015 11:41:28 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41: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:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6119:6261:7903:8526:10004:10400:10848:11026:11232:11658:11914:12296:12517:12519:12663:12679:12740:13069:13311:13357:14096:14097:21080,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 X-HE-Tag: gun13_63e1944141018 X-Filterd-Recvd-Size: 2151 Message-ID: <1441899685.17219.158.camel@perches.com> Subject: Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable From: Joe Perches To: Tejun Heo Cc: Rasmus Villemoes , Maurizio Lombardi , akpm@linux-foundation.org, linux-kernel@vger.kernel.org Date: Thu, 10 Sep 2015 08:41:25 -0700 In-Reply-To: <20150910143629.GB8114@mtj.duckdns.org> References: <1441793590-23856-1-git-send-email-mlombard@redhat.com> <1441816432.17219.57.camel@perches.com> <87mvwv4ea2.fsf@rasmusvillemoes.dk> <1441826799.17219.80.camel@perches.com> <20150910143629.GB8114@mtj.duckdns.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-09-10 at 10:36 -0400, Tejun Heo wrote: > On Wed, Sep 09, 2015 at 12:26:39PM -0700, Joe Perches wrote: > > > > %*pb is meant for smallish bitmaps, not big ones. [] > The use case isn't from me, but why not? Imagine the output of the 500k bitmap if every other bit is set. %*pb isn't capable of multiple line output and seq_printf output would also fail as it uses k.alloc memory not vmalloc. I think that a more limited mechanism might be to use a multiple line oriented function like print_hex_debug and not try to emit the entire thing in a single go. > Why are we even copying the struct on invocations? > Only some functions modify the values after all. > We might as well pass around pointer to the struct > and let the callees wihch modify them copy the > fields in local vars like normal functions. You are of course welcome and able to change it. btw: the current implementation has a limitation on 32 bit arches as it uses an int argument for the unsigned long count of bits in a bitmap. That's a bitmap that should not be printed anyway.