Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp940581pxa; Thu, 27 Aug 2020 21:59:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweM+olnhlkFJlZWCiQ/YMGhaG6n3e0JyxvV4UoJq//95XP+fJfA/nZzJcgoCFUiyPwQKUz X-Received: by 2002:a17:906:d935:: with SMTP id rn21mr25279483ejb.145.1598590792082; Thu, 27 Aug 2020 21:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598590792; cv=none; d=google.com; s=arc-20160816; b=haKIdtm1CI3PrNBW1QbPV3Yux+FNoITlgUfC+Fx7z3UdhCHuBAr1v9MCmCH1+3CUQl 399FR3f5Lc8AnWia+mgoE8Xqx7pzHvP83JaUcLd9KR1aVelBXYDNCmzV3p6QsYWoo/H6 8gUtTZl/3GnGt7O0ZG4628JJS11BRVPEWPFuhltlvsexJsNWP/GYtsBmoNeBUZneRZUB KxBjQGxnR3fGf96gLPS4/GStAC/VZ/OIkFZMMKb/jCRq5PtWaH9EXDJjihdVqAW3HZ+F Qeu85yPeaaZgEtLWkXQBCuGqC4lcf4ut3zMUHHlbLyh0fmqEXyaiCGdhjXCkJrSRjEcq Fp7A== 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=rQ51a6ZqhczKqKZ9alHbmv4Ns5xfHVXMKBCX+93FLQk=; b=AwyiLFhmTF5y7ddgpcL0BeJW2XBJlKpDIeLKzWIdD1vyrVh3bVcOulMXCrNND33idw lQBHHaoJO8UJm1HIzjMpz5Td3ZpK+yVwiacL1Bax+jyNbIqrGGX3WHJO8dOqbbK2UFu4 WK/jrg1xokjhUIi5Xx5cu+3ah3NEvD2OgBhiWSPNBI/TB1invKr7v3ob5WKFcwPLzySq mMdy4/S7PRzjEXqcwAJ3tVnIhF9GSJEQ8H4rUIBMlEZy8UjJzWNDD8F5ZuLkj4r8CmVG gKg1Vur0LIVHWruzBWgvFZzX8IdUE2iCmv6QegVgWTmWxJOKkgub39sJUlFfjxJDReMW Orsg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si2641414ejg.0.2020.08.27.21.59.27; Thu, 27 Aug 2020 21:59:52 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgH1E62 (ORCPT + 99 others); Fri, 28 Aug 2020 00:58:28 -0400 Received: from smtprelay0006.hostedemail.com ([216.40.44.6]:56974 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725894AbgH1E61 (ORCPT ); Fri, 28 Aug 2020 00:58:27 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id E8D7F18018051; Fri, 28 Aug 2020 04:58:25 +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:982:988:989:1260:1277:1311:1313:1314:1345:1359:1394:1431:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3874:4250:4321:5007:8526:10004:10400:10848:10967:11232:11658:11914:12297:12740:12760:12895:13069:13255:13311:13357:13439:14181:14659:14721:21080:21627:21972:30054: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:1,LUA_SUMMARY:none X-HE-Tag: ink23_410c29327073 X-Filterd-Recvd-Size: 1886 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA; Fri, 28 Aug 2020 04:58:24 +0000 (UTC) Message-ID: <1fd895d12c756478ebfb92de1252b772b6fd417a.camel@perches.com> Subject: Re: Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID) From: Joe Perches To: Pekka Paalanen , Algea Cao Cc: mripard@kernel.org, tzimmermann@suse.de, linux-kernel@vger.kernel.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, maarten.lankhorst@linux.intel.com, daniel@ffwll.ch, linux-rockchip@lists.infradead.org Date: Thu, 27 Aug 2020 21:58:22 -0700 In-Reply-To: <20200827103456.57edaf59@eldfell> References: <20200826142328.131144-1-algea.cao@rock-chips.com> <20200827103456.57edaf59@eldfell> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 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 Thu, 2020-08-27 at 10:34 +0300, Pekka Paalanen wrote: > On Wed, 26 Aug 2020 22:23:28 +0800 > Algea Cao wrote: > > > CEA 861.3 spec adds colorimetry data block for HDMI. > > Parsing the block to get the colorimetry data from > > panel. If flags are int, I could imagine another %p extension where %*p is used like: printk("flags: %*pn", flags, bitstrings) where flags is: BIT(0) BIT(1) ... BIT(last) and char *bitstrings[] = { "bit 0 description", "bit 1 description", ... "last bit description" }; Or define YA struct with 2 entries as the struct members and use that. struct foo { unsigned long flags, char ** descriptions, }; struct foo bar = {.flags = .descriptions = bitstrings}; printk("flags: %p\n, &bar);