Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp466865ybb; Fri, 3 Apr 2020 06:15:05 -0700 (PDT) X-Google-Smtp-Source: APiQypJbG1DIJga2GnrxLzPB+a6opYv33bFm+sWqapv6teTIRuY7fJeWAC39D2hsUZKJi6HSwc8t X-Received: by 2002:aca:ec16:: with SMTP id k22mr2896277oih.177.1585919705436; Fri, 03 Apr 2020 06:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585919705; cv=none; d=google.com; s=arc-20160816; b=sjLswwJQVpJOtw9A5tygENvM2bs/DovjadnnNXL3XyO8Y5WJb7RYXYheyNPrc0thTE j5d2Eg5AC93ARAc7b3XSXAXHM6goATrYmDhLrYn54qZTzbwpi9LArua/1FsPuxyPc0kW cb1wiSFoxJggfX1Wqhq+195difW5ynrRvhwm/wRy2uUS4UFYAJQSr7td7/RHc9IYlyeb 8oa8XU35bGfRknJPvxjQJ5/KikRj+EnwsoW6FoD0Q2K7/TtrgsED+Gc1S+IM6aF+ydUP 4I0MGJ4K894smlu8yfMSR7GI29PeK/ix7VypIW40c3qnHqyN/3CixpyTGyTQhy2vQIsU Cu0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=zYK4x0lnySyZj4qc1s4mEP8g5Rfq/4/5Pq90O6Zh5vc=; b=Bc2iY0qcaZtokrblrRubSHI9WGNS2xUeZTopRX0CL7aLRy5FTgA/KmMj7tp8HH/p8D T/KrliItc3uJfnUp4IwbdjBW9cNBxq6HQ+3jDMBR64WuAIzdOuzPBdNg2jg5sMnZ7sj5 AC35xT9nTde1CWrG0aPr5ggMekKsv1ewx65OCEOwgwhUai2CT6ZV3gabsxEyA96a7HCm /adlwgwSavOuRDTqWjmisi0R9wNaBhQjB2TAynYyzDKDWuIvE9zBbWIDJv2kHnobMbH+ y17moyEzXYC40i8HDmP169VfH9zplRz+UUeL4ndli31LJH/yguqUPYSoQK34objLc3YO E+GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si3642331oig.147.2020.04.03.06.14.52; Fri, 03 Apr 2020 06:15:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403853AbgDCNNX (ORCPT + 99 others); Fri, 3 Apr 2020 09:13:23 -0400 Received: from smtprelay0139.hostedemail.com ([216.40.44.139]:51020 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726087AbgDCNNW (ORCPT ); Fri, 3 Apr 2020 09:13:22 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 955A4182CED34; Fri, 3 Apr 2020 13:13:21 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2692:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3873:4321:5007:6120:6742:7901:7904:10004:10400:10848:11026:11232:11658:11914:12043:12297:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21433:21611:21627:30034:30054:30069: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:0:0,LFtime:8,LUA_SUMMARY:none X-HE-Tag: lake39_5738fffbee928 X-Filterd-Recvd-Size: 2320 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Fri, 3 Apr 2020 13:13:19 +0000 (UTC) Message-ID: Subject: Re: [PATCH 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs From: Joe Perches To: Jani Nikula , Sakari Ailus , Petr Mladek Cc: mchehab@kernel.org, Dave Stevenson , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hverkuil@xs4all.nl, Sergey Senozhatsky , Steven Rostedt , laurent.pinchart@ideasonboard.com, Andy Shevchenko , linux-media@vger.kernel.org, Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= Date: Fri, 03 Apr 2020 06:11:22 -0700 In-Reply-To: <87zhbtkrc5.fsf@intel.com> References: <20200401140522.966-1-sakari.ailus@linux.intel.com> <87eet6mgk7.fsf@intel.com> <04bb934e551f43540d1daacd2759beacc0b3116a.camel@perches.com> <87zhbtkrc5.fsf@intel.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-04-03 at 09:37 +0300, Jani Nikula wrote: > On Thu, 02 Apr 2020, Joe Perches wrote: > > On Thu, 2020-04-02 at 11:34 +0300, Jani Nikula wrote: > > > Or could we conceive of a way to make this locally extensible yet safe, > > > letting callers use something like %{foo}, as well as providing a > > > locally relevant function to do the conversion? > > > > No. printf validation would be broken. > > I tossed the idea on a whim, and thinking further I could probably come > up with a number of challenges, but care to elaborate on what you see as > the problem in validation? I understand you to want to add something like % where m is a non-standard format specifier so using using gcc's extension of __attribute__((__format__(printf, string_index, first_to_check)) could not validate the argument type against use of the % in the format string. printk("%a\n", a); Compiler bleats.