From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753634AbcBENGw (ORCPT ); Fri, 5 Feb 2016 08:06:52 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:47090 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753610AbcBENGu (ORCPT ); Fri, 5 Feb 2016 08:06:50 -0500 MIME-Version: 1.0 In-Reply-To: <87y4b0m35z.fsf@rasmusvillemoes.dk> References: <1454540721.7291.141.camel@perches.com> <1454542185-1147-1-git-send-email-Jason@zx2c4.com> <87y4b0m35z.fsf@rasmusvillemoes.dk> Date: Fri, 5 Feb 2016 14:06:43 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] vsprintf: automatic parameters for %pIS via 'a' From: "Jason A. Donenfeld" To: Rasmus Villemoes Cc: Joe Perches , Daniel Borkmann , Andrew Morton , andriy.shevchenko@linux.intel.com, LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 5, 2016 at 1:06 AM, Rasmus Villemoes wrote: > First of all I don't think vsprintf.c should be extended with yet > another piece of unused code, so I hope there's an actual user coming. There is. Don't worry. > > Second, please add tests to lib/test_printf.c. Sure, no problem. I'll add this in the next version. > > Third, wouldn't it be more convenient/flexible if a meant "print those > that are present _and_ requested"; that is, the above would be > >> + have_p = have_p && sa->sin6_port; >> + have_s = have_s && sa->sin6_scope_id; >> + have_f = have_f && sa->sin6_flowinfo & IPV6_FLOWINFO_MASK; > > that way one could say %pISaf and have the flowinfo if and only if it's > present, without also unintentionally turning on port or scope_id. That's a great idea. I'll make this change too for the next version.