From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10152C2BA15 for ; Thu, 2 Apr 2020 13:53:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8E6E20757 for ; Thu, 2 Apr 2020 13:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585835611; bh=e2mD8+QaUawKZUIdArDDRCxzyP8fJnIv/2Fv/9jRSbc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=LpBQ1TIZW65Tlzc885r2UXVP/F+Vvm5M/yAWDuLpcHt2+dEWRge3uR/jKuPep/a45 b3FHPAxSGTmsvhoCw4lHc4Z8WOHu6ux5eJj4PInkZploiwypbKWazkIOY5gYzEj11m frDtcmyfQSJ1ymKQ5YCVAR4jxro6CC8/WJql25K8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732402AbgDBNxa (ORCPT ); Thu, 2 Apr 2020 09:53:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:35924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726425AbgDBNxa (ORCPT ); Thu, 2 Apr 2020 09:53:30 -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 2767E2073B; Thu, 2 Apr 2020 13:53:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585835610; bh=e2mD8+QaUawKZUIdArDDRCxzyP8fJnIv/2Fv/9jRSbc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aFK8PuE53AAEurbQ6VeYnOyh1G1pTUhbgyXsdRg2MbipOPO+gI+JyCrvqROJ7R9rS zV8JP+Cg4wd7in8MVjarXIHfQ+KYx9XwXc/A/QoFB+R6f4ATHc5wTAdHiWi5Uz7zjx Vb0Bim6QH05Wpi4bYe/MGDPagBZszEj1kfYIgaQ4= Date: Thu, 2 Apr 2020 15:53:23 +0200 From: Mauro Carvalho Chehab To: Jani Nikula Cc: Sakari Ailus , Petr Mladek , 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 =?UTF-8?B?U3lyasOkbMOk?= Subject: Re: [PATCH 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs Message-ID: <20200402155323.6866b5c9@coco.lan> In-Reply-To: <87eet6mgk7.fsf@intel.com> References: <20200401140522.966-1-sakari.ailus@linux.intel.com> <87eet6mgk7.fsf@intel.com> 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 Thu, 02 Apr 2020 11:34:48 +0300 Jani Nikula escreveu: > On Wed, 01 Apr 2020, 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. > > I'm not going to take a strong stand in one way or the other regarding > the patch at hand, but I do think at some point we have to draw a line > what should be included in printk formats. Arguably they should be > reserved to things that are generally useful across large parts of the > kernel, right? > > I think the more specialized you get, the more you should think about > just using the plain old %s, and your own helpers. As I suggested it, from my side, I'd like to have it inside printk :-) There is a subset of formats that are subsystem-specific anyway at printk, like the network ones. We use extensively fourcc along the media subsystem (and you probably also use fourcc at DRM). Even some input devices nowadays may be using V4L2 core (some multi-sensor touching devices), with depends on it. So, those fourcc codes are pretty common. Having it at the printk infra makes a lot easier for people to use them. > Because frankly, the > kernel printk specifiers also start getting more than a little obscure. I liked one of the suggestions of using "%p4cc" (or maybe something similar, if having a number there is a problem, like "%pAcc" or "%pfcc") for this printk. This would be very easy for people to identify and remember about its meaning. > 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? That's something that it makes sense to be implemented in the future, for things that would be self-contained inside an specific subsystem. Thanks, Mauro