<html><body><p>
<pre>
Hi, Angelo:
On Wed, 2024-02-07 at 15:52 +0100, AngeloGioacchino Del Regno wrote:
> Change magic numerical masks with usage of the GENMASK() macro
> to improve readability.
>
> This commit brings no functional changes.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> ---
> 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..c66e18006070 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -58,18 +58,18 @@
>
> #define DSI_TXRX_CTRL0x18
> #define VC_NUMBIT(1)
> -#define LANE_NUM(0xf << 2)
> +#define LANE_NUMGENMASK(5, 2)
> #define DIS_EOTBIT(6)
> #define NULL_ENBIT(7)
> #define TE_FREERUNBIT(8)
> #define EXT_TE_ENBIT(9)
> #define EXT_TE_EDGEBIT(10)
> -#define MAX_RTN_SIZE(0xf << 12)
> +#define MAX_RTN_SIZEGENMASK(15, 12)
> #define HSTX_CKLP_ENBIT(16)
>
> #define DSI_PSCTRL0x1c
> -#define DSI_PS_WC0x3fff
> -#define DSI_PS_SEL(3 << 16)
> +#define DSI_PS_WCGENMASK(13, 0)
> +#define DSI_PS_SELGENMASK(17, 16)
> #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_ENBIT(2)
>
> #define DSI_PHY_TIMECON00x110
> -#define LPX(0xff << 0)
> -#define HS_PREP(0xff << 8)
> -#define HS_ZERO(0xff << 16)
> -#define HS_TRAIL(0xff << 24)
> +#define LPXGENMASK(7, 0)
> +#define HS_PREPGENMASK(15, 8)
> +#define HS_ZEROGENMASK(23, 16)
> +#define HS_TRAILGENMASK(31, 24)
>
> #define DSI_PHY_TIMECON10x114
> -#define TA_GO(0xff << 0)
> -#define TA_SURE(0xff << 8)
> -#define TA_GET(0xff << 16)
> -#define DA_HS_EXIT(0xff << 24)
> +#define TA_GOGENMASK(7, 0)
> +#define TA_SUREGENMASK(15, 8)
> +#define TA_GETGENMASK(23, 16)
> +#define DA_HS_EXITGENMASK(31, 24)
>
> #define DSI_PHY_TIMECON20x118
> -#define CONT_DET(0xff << 0)
> -#define CLK_ZERO(0xff << 16)
> -#define CLK_TRAIL(0xff << 24)
> +#define CONT_DETGENMASK(7, 0)
> +#define CLK_ZEROGENMASK(23, 16)
> +#define CLK_TRAILGENMASK(31, 24)
>
> #define DSI_PHY_TIMECON30x11c
> -#define CLK_HS_PREP(0xff << 0)
> -#define CLK_HS_POST(0xff << 8)
> -#define CLK_HS_EXIT(0xff << 16)
> +#define CLK_HS_PREPGENMASK(7, 0)
> +#define CLK_HS_POSTGENMASK(15, 8)
> +#define CLK_HS_EXITGENMASK(23, 16)
>
> #define DSI_VM_CMD_CON0x130
> #define VM_CMD_ENBIT(0)
> @@ -138,13 +138,14 @@
> #define FORCE_COMMITBIT(0)
> #define BYPASS_SHADOWBIT(1)
>
> -#define CONFIG(0xff << 0)
> +/* CMDQ related bits */
> +#define CONFIGGENMASK(7, 0)
> #define SHORT_PACKET0
> #define LONG_PACKET2
> #define BTABIT(2)
> -#define DATA_ID(0xff << 8)
> -#define DATA_0(0xff << 16)
> -#define DATA_1(0xff << 24)
> +#define DATA_IDGENMASK(15, 8)
> +#define DATA_0GENMASK(23, 16)
> +#define DATA_1GENMASK(31, 24)
>
> #define NS_TO_CYCLE(n, c) ((n) / (c) + (((n) % (c)) ? 1 : 0))
>
</pre>
</p></body></html><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice
********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->