Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3143187rdb; Tue, 6 Feb 2024 08:18:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2CqS4a+lPHKcj+ijXBYUNwYJz3EP26OEqX/WJ4Tw8Xxqfdy1rFsQqxAlpcsJm162qh78Q X-Received: by 2002:a05:6a00:2348:b0:6db:be80:cad5 with SMTP id j8-20020a056a00234800b006dbbe80cad5mr7497pfj.20.1707236287244; Tue, 06 Feb 2024 08:18:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707236287; cv=pass; d=google.com; s=arc-20160816; b=kulF5fFurJ7dn06qm8WzXzciy4N3nWh3AuX4ykJABoS/hsaCljNCyTpbJIEE4tt9Ja ZxlNkkekAHaCFNVy2zLzyjFzmPEM7eR0TvnbaadUSxDTEWPGAkYpng16UkWY5iM3n56D o/fsJ1dfrWjGtuAi5jlt8YIK0Lm/OoAg/mvRGGolWtXpA5DsTDGLSpRJ344LVuF6xk8e iW1iuXR3hi2ccVNBjTlv6TLaeSt5WUho/s43Wf4SbfE+r/EreyUJRmOQC2HSRC0TCxnL sxIPEwvW73K4bsilTuvezqYOv/Avp3ryy0rlx8AmzOGEG/qe12Ojvg8AkCKUk80T/xxv 1vwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=aecDRBBI7bdXtD+aN5xGPOj9CCxjVL5QRYuaYsZ85nc=; fh=xsQLE6MQBcQfQCC1U3wSaKPQW5cf/1Kl8ywBM0KCjgY=; b=Kg395kwMmptwpm+hykbJLQ3WW3TbJMB8wzUD+bRjORXx3gaq1Pjty17zk6xkY+3CPc OLpjh9ci+lSXNu0miLvuy07FiBy/5h18ZkaH2MvbzhZBYuuRj6eueka39EAgnhVsSex2 meFlAa8rjUSIYKM2O0gcJBhVK4xjxe9MNSAHG//NAOmWZ+GUXJulQGv6IAoatfUop3PN 4gs371djjAR8E79G1g843/xFmpTumfz6cz9KFQh74fDwENo6RqjMNKOPuLp7y7FISREa AYczjjRp7ZeYm26YMfe43OGASfdbhgWWsFZtAZHrcdNMeHbKwHXbFSESZE3LqnLfCRN6 ufyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=V7K5QaTF; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-55281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55281-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=1; AJvYcCXncLvUSNnrQzZQKwNn2WVZG/OoOmo4kjuGenhIA0GQoeBlAihaOdfKV24MO7vOgbA/puctkSNqkHwarJ1lI7JQsyWniuF+4woykXVhvg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d20-20020a630e14000000b005c2786b7e32si1927720pgl.812.2024.02.06.08.18.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 08:18:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=V7K5QaTF; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-55281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55281-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4145EB27E04 for ; Tue, 6 Feb 2024 15:54:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BAFB134735; Tue, 6 Feb 2024 15:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="V7K5QaTF" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88CCE134CCC for ; Tue, 6 Feb 2024 15:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707234841; cv=none; b=ckLP4zSFe1xTtBn8egAoHVeNKMgVkC5GJKu95H4u0zqDUPgqbxJuqFNBlbXSz9yAgb75NKbtqGGy87UjdFkhRLM9SWHmLM3nbxcHUxdQXGm5E9KevPAZi/qhnqd9/QNvZ+xto4739jvxFHgEnMRrWtY9jOXX70B/maEsv7DG4qI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707234841; c=relaxed/simple; bh=ocHaZpvDjxc0rwWNi54f+f6bams80D+RxoX1ovTeVl4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eN+ynpH4vegPI86e7QMp9dYrXYW0gfmSe2qBs+qNmItkUsNQ4eywf4A3hFvRuyTYJA9ltflpfk1rgyF+1BfMIXOC2KTtlPIT4VAx77e1ZVOCm0JoRE1/++dN29e3lMAt1bXM0aj7vXebAYDxaRUEzIdil/0pHhdyUBXuRJxO+sA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=V7K5QaTF; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707234837; bh=ocHaZpvDjxc0rwWNi54f+f6bams80D+RxoX1ovTeVl4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=V7K5QaTFmBBj0jF9OBR5noaRpQTZDw9Xl5i1A050PYI1Pv9NppAiV7yHeTBDp5nEN 7LckCp+WWAF8/QJQrikGSGvJydLGMjuSlmFWBQa804UzNxojOI2zARlmeMuiejyzcf Gt8wNMvbT7i5xT5flazIdXjg50s6SaJe6ngZnwVVyF9vZyZ76G+lYlbBHypn5L2f3b E+jvFsHCXt/eiaKk8Dt+Ey6G/tsgL0FR58ISC5cJO9vie0l5n9oGkt0XMDUnBqNuS3 gc4WgpIO2qQxYRqTR0yVI2BtKWCjnQnbgqwGiqxAMdTot8z9h/xbKNxZTN9lt+0g1d QsBZ3YcbvWHqQ== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D92CF37803EE; Tue, 6 Feb 2024 15:53:56 +0000 (UTC) Message-ID: Date: Tue, 6 Feb 2024 16:53:56 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/9] drm/mediatek: dsi: Use GENMASK() for register mask definitions Content-Language: en-US To: Alexandre Mergnat , chunkuang.hu@kernel.org Cc: fshao@chromium.org, p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com References: <20240206120748.136610-1-angelogioacchino.delregno@collabora.com> <20240206120748.136610-2-angelogioacchino.delregno@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Il 06/02/24 15:47, Alexandre Mergnat ha scritto: > > > On 06/02/2024 13:07, AngeloGioacchino Del Regno wrote: >> Change magic numerical masks with usage of the GENMASK() macro >> to improve readability. >> >> While at it, also fix the DSI_PS_SEL mask to include all bits instead >> of just a subset of them. >> >> This commit brings no functional changes. >> >> Signed-off-by: AngeloGioacchino Del Regno >> --- >>   drivers/gpu/drm/mediatek/mtk_dsi.c | 45 +++++++++++++++--------------- >>   1 file changed, 23 insertions(+), 22 deletions(-) >> >> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c >> index a2fdfc8ddb15..3b7392c03b4d 100644 >> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c >> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c >> @@ -58,18 +58,18 @@ > > ...snip... > >>   #define DSI_PSCTRL        0x1c >> -#define DSI_PS_WC            0x3fff >> -#define DSI_PS_SEL            (3 << 16) >> +#define DSI_PS_WC            GENMASK(14, 0) >> +#define DSI_PS_SEL            GENMASK(19, 16) > > 0011 0000 0000 0000 0000 => GENMASK(17, 16) Alexandre, the reason for that is in the commit description :-P "While at it, also fix the DSI_PS_SEL mask to include all bits instead of just a subset of them." Thanks for the reviews, btw! Cheers! Angelo > >>   #define PACKED_PS_16BIT_RGB565        (0 << 16) >>   #define LOOSELY_PS_18BIT_RGB666        (1 << 16) >>   #define PACKED_PS_18BIT_RGB666        (2 << 16) >> @@ -109,26 +109,26 @@ >>   #define LD0_WAKEUP_EN            BIT(2) >