diff options
| author | Sreeraj S Kurup <sreekuttan2156239@gmail.com> | 2026-07-28 12:28:10 +0000 |
|---|---|---|
| committer | Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> | 2026-09-10 10:09:58 +0200 |
| commit | 13335fca4c23b1a6736ec9c7efc3750154a2ca24 (patch) | |
| tree | 87c5e4f76e724b33c174cb9527c26f04a4bc6da4 /scripts/basic/split-include.c | |
| parent | cee9395acd8043be0644b25c34bfa86623f2b935 (diff) | |
| download | linux-13335fca4c23b1a6736ec9c7efc3750154a2ca24.tar.gz linux-13335fca4c23b1a6736ec9c7efc3750154a2ca24.zip | |
PCI: mediatek-gen3: Fix 64-bit type truncation in mtk_pcie_set_trans_table()
The variables cpu_addr, pci_addr, and remaining in
mtk_pcie_set_trans_table() are of type resource_size_t, which is 64-bit
on 64-bit architectures.
Using 32-bit helpers fls(), ffs(), and BIT() causes 64-bit integer
truncation when computing window sizes and address alignments above 4GB.
Fix this by switching to fls64(), __ffs64(), and BIT_ULL(). Note that
__ffs64() uses 0-based indexing, so the '- 1' offset is removed.
Additionally, return -ENOMEM when translation tables are exhausted to
prevent silent failure.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260728122810.3475-1-sreekuttan2156239@gmail.com
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
