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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 2747DC433E0 for ; Tue, 9 Feb 2021 09:11:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E216864D5D for ; Tue, 9 Feb 2021 09:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbhBIJKq (ORCPT ); Tue, 9 Feb 2021 04:10:46 -0500 Received: from mga12.intel.com ([192.55.52.136]:12467 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230444AbhBIJGG (ORCPT ); Tue, 9 Feb 2021 04:06:06 -0500 IronPort-SDR: D/GSWDht4f3DtbfLGoyF6mqZBOcMEKz+OU3lDqYl4fEm18IZPKUlwZGEn1lkOmcBIhGXGR2CtZ QIG0O3oKJtog== X-IronPort-AV: E=McAfee;i="6000,8403,9889"; a="161003451" X-IronPort-AV: E=Sophos;i="5.81,164,1610438400"; d="scan'208";a="161003451" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 01:03:38 -0800 IronPort-SDR: SU9qFKNtrmpEC6JKaNynq0fO/IFTngaOUhFXJnX/iTmDVW546Xcv/uiyj8dNX0p6k3nyU9cVh5 o+4WbDlsXhSg== X-IronPort-AV: E=Sophos;i="5.81,164,1610438400"; d="scan'208";a="436017955" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 01:03:34 -0800 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 8B611206D0; Tue, 9 Feb 2021 11:03:02 +0200 (EET) Date: Tue, 9 Feb 2021 11:03:02 +0200 From: Sakari Ailus To: Daniel Vetter Cc: Linux Kernel Mailing List , Petr Mladek , Mauro Carvalho Chehab , Dave Stevenson , Rasmus Villemoes , dri-devel , Hans Verkuil , Sergey Senozhatsky , Steven Rostedt , Laurent Pinchart , Joe Perches , Andy Shevchenko , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH v6 3/3] drm/fourcc: Switch to %p4cc format modifier Message-ID: <20210209090302.GB32460@paasikivi.fi.intel.com> References: <20210208200903.28084-1-sakari.ailus@linux.intel.com> <20210208200903.28084-4-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, Thanks for the comments. On Tue, Feb 09, 2021 at 08:27:10AM +0100, Daniel Vetter wrote: > On Mon, Feb 8, 2021 at 9:20 PM Sakari Ailus > wrote: > > > > Instead of constructing the FourCC code manually, use the %p4cc printk > > modifier to print it. Also leave a message to avoid using this function. > > > > The next step would be to convert the users to use %p4cc directly instead > > and removing the function. > > > > Signed-off-by: Sakari Ailus > > --- > > drivers/gpu/drm/drm_fourcc.c | 16 +++------------- > > 1 file changed, 3 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c > > index 03262472059c..4ff40f2f27c0 100644 > > --- a/drivers/gpu/drm/drm_fourcc.c > > +++ b/drivers/gpu/drm/drm_fourcc.c > > @@ -30,11 +30,6 @@ > > #include > > #include > > > > -static char printable_char(int c) > > -{ > > - return isascii(c) && isprint(c) ? c : '?'; > > -} > > - > > /** > > * drm_mode_legacy_fb_format - compute drm fourcc code from legacy description > > * @bpp: bits per pixels > > @@ -134,17 +129,12 @@ EXPORT_SYMBOL(drm_driver_legacy_fb_format); > > * drm_get_format_name - fill a string with a drm fourcc format's name > > * @format: format to compute name of > > * @buf: caller-supplied buffer > > + * > > + * Please use %p4cc printk format modifier instead of this function. > > I think would be nice if we could roll this out and outright delete > this one here ... Quick git grep says there's not that many, and %p4cc > is quite a bit shorter than what we have now. Sounds good; I can submit patches for that but I think I'll do that once we have the %p4cc modifier in. -- Regards, Sakari Ailus