]> www.infradead.org Git - users/willy/xarray.git/commit
soc: mediatek: mtk-mutex: Reduce type size for mtk_mutex_data members
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 29 Jul 2024 12:25:38 +0000 (14:25 +0200)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 30 Jul 2024 08:58:46 +0000 (10:58 +0200)
commitd1e5d531d20b085bb83d9ab1868ed99fdeb0cc42
tree5775e9dfa2c741ebcd5c70fd6af18404d65c6290
parent1c28c9452d521bf21dc5d2c50a47c2e43002728d
soc: mediatek: mtk-mutex: Reduce type size for mtk_mutex_data members

All of mutex_mod and mutex_table_mod contain an array of bit
numbers, which can go from 0 to 63, it is hence not needed to
use an unsigned 32-bits integer to store that: change them to
unsigned 8-bits instead.

As for the mutex_sof table since this directly contains the values
to write to the DISP_MUTEXn_CTL register, which has only bits [13:0]
(so this register is effectively 14 bits long), change that to use
unsigned 16-bits.

The type of mutex_{mod,sof}_reg was also changed to 16 bits, as
the maximum value that those will ever have is 0x800, because it
calculates as 0x30 + (0x20 * n) where n's maximum value is 63.

This reduces module size and brings no functional changes.

Before:
   text    data     bss     dec     hex filename
   9929     512       0   10441    28c9 mtk-mutex.o

After:
   text    data     bss     dec     hex filename
   7425     512       0    7937    1f01 mtk-mutex.o

Link: https://lore.kernel.org/r/20240729122538.989855-1-angelogioacchino.delregno@collabora.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
drivers/soc/mediatek/mtk-mutex.c