Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4316100pxb; Mon, 8 Feb 2021 13:19:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYtIaJlpjyd2RZ9zAo2Vha+oVkokT3xnuusRgWpLOH7cfsQgHkjZBMgzhGZxOWGPtcNRmc X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr18743954ejb.540.1612819143906; Mon, 08 Feb 2021 13:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612819143; cv=none; d=google.com; s=arc-20160816; b=kG7I4SuPnxIFUqchrKlb6qCwTesAYVpv6xr84X5k0kB5+lwBRzL/waDZqfHrA0uRYw lJdsUdL+0/I/Efl36tM11rLFDd3zXi484AkHeBPBJV503z3r81amakkKhe70fSvXy5SL +msAee/pv18mezW3FwdeftfcQyyI5fJosB30VoRmyZFG+2ebpLuX25Zn3zhz+u6y/Ea8 O1D1qZTK8e95TGhmbb+b9Pclzrs0Kp17WiZz1pYzEY/4/OFXK3RhJ7z2Xo9kzKOVriu4 PvR0is1U5nYmK1gs1/5YXrePKVq20HzmoIHdxi4zr3ebbnfvuglj6Nv70gd2Z+4qrRbS QZ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=CQ5OZNVmuuSjM3Pb2sjhC64QphtIPQWLwnq8FQs0Ok4=; b=rB7Nq10RkQJSiIgVCMhF/x+TM93R2IyO0dUC/J9XHtkczSOqF64akJsbVF8Rpj0Pfo uiNbgny7aMMw0LnfkstOczVJtfxKLMDJXkdtC/Hq7VMT9tuSlmE7+RBne5ScdHF7kdeN d7U2rZXhE7uaz9OT2FPdFQ3qTQMhU1qM2clgzupZuTF3i0pHtqyut195Jj7zxytW0TzL SSRWRxJpW+JKvNhCk2XED7C7kFur2Kyhnn2HpglTFeRZUUPHyUU6Hk1NC50VHruAdFLy ukb2zHvff/IHn2ITi/u7BBUq7aWcGUa3JP164J60A9ACTMlRGAsEXQgCYBJtkdwSH1Qo K+Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si10291332edo.374.2021.02.08.13.18.40; Mon, 08 Feb 2021 13:19:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234033AbhBHVSG (ORCPT + 99 others); Mon, 8 Feb 2021 16:18:06 -0500 Received: from retiisi.eu ([95.216.213.190]:57072 "EHLO hillosipuli.retiisi.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235241AbhBHUKw (ORCPT ); Mon, 8 Feb 2021 15:10:52 -0500 Received: from lanttu.localdomain (lanttu-e.localdomain [192.168.1.64]) by hillosipuli.retiisi.eu (Postfix) with ESMTP id B3728634C87; Mon, 8 Feb 2021 22:08:33 +0200 (EET) From: Sakari Ailus To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Andy Shevchenko , Petr Mladek , Dave Stevenson , dri-devel@lists.freedesktop.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, Sergey Senozhatsky , Steven Rostedt , Joe Perches , Jani Nikula , Rasmus Villemoes Subject: [PATCH v6 0/3] Add %p4cc printk modifier for V4L2 and DRM fourcc codes Date: Mon, 8 Feb 2021 22:09:00 +0200 Message-Id: <20210208200903.28084-1-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This set adds support for %p4cc printk modifier for printing V4L2 and DRM fourcc codes. The codes are cumbersome to print manually and by adding the modifier, this task is saved from the V4L2 and DRM frameworks as well as related drivers. DRM actually had it handled in a way (see 3rd patch) but the printk modifier makes printing the format easier even there. On V4L2 side it saves quite a few lines of repeating different implementations of printing the 4cc codes. Further work will include converting the V4L2 drivers doing the same, as well as converting DRM drivers from drm_get_format_name() to plain %p4cc. I left these out from this version since individual drivers are easier changed without dealing with multiple trees. If DRM folks would prefer to convert drivers to %p4cc directly instead I have no problem dropping the 3rd patch. Nearly all uses in DRM are in printk family of functions that can readily use %p4cc instead of the current arrangement that relies on caller-allocated temporary buffer. Since v5: - Added V4L2 core conversion to %p4cc, as well as change the DRM fourcc printing function to use %p4cc. - Add missing checkpatch.pl checks for %p4cc modifier. Sakari Ailus (3): lib/vsprintf: Add support for printing V4L2 and DRM fourccs v4l: ioctl: Use %p4cc printk modifier to print FourCC codes drm/fourcc: Switch to %p4cc format modifier Documentation/core-api/printk-formats.rst | 16 +++++ drivers/gpu/drm/drm_fourcc.c | 16 +---- drivers/media/v4l2-core/v4l2-ioctl.c | 85 ++++++----------------- lib/test_printf.c | 17 +++++ lib/vsprintf.c | 51 ++++++++++++++ scripts/checkpatch.pl | 6 +- 6 files changed, 112 insertions(+), 79 deletions(-) -- 2.29.2