Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp733499ybb; Fri, 3 Apr 2020 10:48:25 -0700 (PDT) X-Google-Smtp-Source: APiQypKrguf59hCgZqIZEyGd1PumOy0CJVPZAfVx8x+h+en1LDiDwjff54h3KpncKG7DPLAtDPU8 X-Received: by 2002:a05:6830:11d5:: with SMTP id v21mr7494215otq.91.1585936105683; Fri, 03 Apr 2020 10:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585936105; cv=none; d=google.com; s=arc-20160816; b=VEJRBS1ZfmfdInAK20KQ86GFVTnq30n8PfXjNH5jXo3YsvCTLf2Lvn6xRy+ISsSO8l HDAMVFJ8d9i/WdVoSlFWXhNb4qz2U4OSPkjRdygiVBD9dYqNnm2Lb2KXcpGmQ0/DRq/l ofLweydQaoRyb8Pajdm+UVdROmaByVuEn70Pg5m4v86ZDuttNPS49jMeYnX+7XPBpIfL M+Z++l5D4KwBDd70zs5QBm5NIX8+QhNv1z7r/hdjBwuiJbRM9mEH3YcQNkwCT0reNaDf i2lnNhWCa++qj42VxHvElSUHI2qXv71Y8T/dforvi5pJFY32OQzW/VSie6bXZyzMsp3Y nhqA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9W2zsvP82VsQMvExAsTK9ifBjMtnV1wWASBo5xdnT6M=; b=psDocyiY+0Dw5RnxI3vmy1dSsYzULQHy9MwtfyrubHhyypQf+Pugo4L0nhtyr5KEME htGiqLZ3gLU92UIa/XVSkHI/IOMGpJpWkRsjX4/NM4Mt8p9y9HG02zOpcCL/HIe9IQRy 4ruS7YNhxjEP+3j3QK08v0gvqSEei++y5TCdzQnexz0Aa1QPq8QGslVLW95AUZW/mIlY RlU+w0EDhhIDCwkhZQmk49y0kI6NsShyj0dfKSE2wJ4uFZk1nog9XCvpeId8UeICt93i rMCFeJs/w5Fo1xFHXK9x+YrbYH7eFIaQiKW6YyhpKn1ZHrW2K/At0NzuPeiFcv49CyQ3 hlXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wm68y4B9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si3875572oie.6.2020.04.03.10.48.13; Fri, 03 Apr 2020 10:48:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=wm68y4B9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404439AbgDCRct (ORCPT + 99 others); Fri, 3 Apr 2020 13:32:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404218AbgDCRct (ORCPT ); Fri, 3 Apr 2020 13:32:49 -0400 Received: from coco.lan (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 721DB20737; Fri, 3 Apr 2020 17:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585935168; bh=14knU8ACVNnK6xW1RmVIrSOB5671IbOcqMn1tJl9NDw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wm68y4B9nhyQFatl2Bgxi3vs96I1A1u7J82pUriMabS91oVeNYd9BUXgQLAfo9Etm +gfYJ18RfNCgKP3wZlitJoErVSDqJ024fmvOXyKz6xppqqyOMF0MWlkDDXhi5LgZ96 wuqjofHdtLjLRmAj8pPHSj7MiNc6SVvJwkfGieeQ= Date: Fri, 3 Apr 2020 19:32:42 +0200 From: Mauro Carvalho Chehab To: Joe Perches Cc: Rasmus Villemoes , Sakari Ailus , Petr Mladek , Andy Shevchenko , linux-media@vger.kernel.org, Dave Stevenson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, Sergey Senozhatsky , Steven Rostedt , Jani Nikula Subject: Re: [PATCH v2 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs Message-ID: <20200403193242.38611906@coco.lan> In-Reply-To: References: <20200403091156.7814-1-sakari.ailus@linux.intel.com> <1105bfe5-88f1-040e-db40-54d7761747d5@rasmusvillemoes.dk> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, 03 Apr 2020 09:56:42 -0700 Joe Perches escreveu: > On Fri, 2020-04-03 at 14:10 +0200, Rasmus Villemoes wrote: > > On 03/04/2020 11.11, Sakari Ailus wrote: > > > Add a printk modifier %ppf (for pixel format) for printing V4L2 and DRM > > > pixel formats denoted by 4ccs. The 4cc encoding is the same for both so > > > the same implementation can be used. > > > > This seems quite niche to me, I'm not sure that belongs in vsprintf.c. > > What's wrong with having a > > > > char *fourcc_string(char *buf, u32 x) > > > > that formats x into buf and returns buf, so it can be used in a > > > > char buf[8]; > > pr_debug("bla: %s\n", fourcc_string(buf, x)) > > Nothing really, it's a number of uses question. > > For networking code, print_mac was used before %pM. > > After Linus floated the idea of %p, %pM was > introduced and all the DECLARE_MAC_BUF/print_mac > calls were converted. > > %pM did reduce overall object size a fair amount. > > How many instances of %p4cc could there be? That's hard to know... there are several places printing it with different ways: $ git grep -i -E "(dev|pr)_(warn|dbg|info)" drivers/media|grep pixf|wc -l 6 $ git grep -i -E "print" drivers/media|grep pixf|wc -l 1 $ git grep print_fourcc|wc -l 7 $ git grep -i -E "(dev|pr)_(warn|dbg|info)" drivers/media|grep pixelf|wc -l 10 $ git grep -i -E "(dev|pr|v4l)_(warn|dbg|info)" drivers/media|grep format|wc -l 60 I bet there are other places besides the above ones, but the thing is, as we currently lack a standard way, drivers still have their own ideas about how to handle it. Each one does it differently. Thanks, Mauro