1 | Reduce the scope of some loop counters as these aren't needed outside | 1 | Reduce the scope of some loop counters as these aren't needed outside |
---|---|---|---|
2 | the loops they're used in. | 2 | the loops they're used in. |
3 | 3 | ||
4 | Signed-off-by: Alexandru Dadu <alexandru.dadu@imgtec.com> | 4 | Signed-off-by: Alexandru Dadu <alexandru.dadu@imgtec.com> |
5 | --- | 5 | --- |
6 | Changes in v2: | ||
7 | - Remove a loop counter variable definition | ||
8 | - Link to v1: https://lore.kernel.org/r/20250401-for-loop-counter-scope-v1-1-5ba75770be52@imgtec.com | ||
9 | --- | ||
6 | drivers/gpu/drm/imagination/pvr_debugfs.c | 3 +-- | 10 | drivers/gpu/drm/imagination/pvr_debugfs.c | 3 +-- |
7 | drivers/gpu/drm/imagination/pvr_free_list.c | 3 +-- | 11 | drivers/gpu/drm/imagination/pvr_free_list.c | 3 +-- |
8 | drivers/gpu/drm/imagination/pvr_fw.c | 11 ++++------- | 12 | drivers/gpu/drm/imagination/pvr_fw.c | 12 ++++-------- |
9 | drivers/gpu/drm/imagination/pvr_fw_meta.c | 3 +-- | 13 | drivers/gpu/drm/imagination/pvr_fw_meta.c | 3 +-- |
10 | drivers/gpu/drm/imagination/pvr_fw_mips.c | 6 ++---- | 14 | drivers/gpu/drm/imagination/pvr_fw_mips.c | 6 ++---- |
11 | drivers/gpu/drm/imagination/pvr_fw_trace.c | 23 ++++++++--------------- | 15 | drivers/gpu/drm/imagination/pvr_fw_trace.c | 23 ++++++++--------------- |
12 | drivers/gpu/drm/imagination/pvr_gem.c | 4 +--- | 16 | drivers/gpu/drm/imagination/pvr_gem.c | 4 +--- |
13 | drivers/gpu/drm/imagination/pvr_hwrt.c | 12 ++++-------- | 17 | drivers/gpu/drm/imagination/pvr_hwrt.c | 12 ++++-------- |
14 | drivers/gpu/drm/imagination/pvr_stream.c | 12 ++++-------- | 18 | drivers/gpu/drm/imagination/pvr_stream.c | 12 ++++-------- |
15 | drivers/gpu/drm/imagination/pvr_vm_mips.c | 3 +-- | 19 | drivers/gpu/drm/imagination/pvr_vm_mips.c | 3 +-- |
16 | 10 files changed, 27 insertions(+), 53 deletions(-) | 20 | 10 files changed, 27 insertions(+), 54 deletions(-) |
17 | 21 | ||
18 | diff --git a/drivers/gpu/drm/imagination/pvr_debugfs.c b/drivers/gpu/drm/imagination/pvr_debugfs.c | 22 | diff --git a/drivers/gpu/drm/imagination/pvr_debugfs.c b/drivers/gpu/drm/imagination/pvr_debugfs.c |
19 | index XXXXXXX..XXXXXXX 100644 | 23 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/drivers/gpu/drm/imagination/pvr_debugfs.c | 24 | --- a/drivers/gpu/drm/imagination/pvr_debugfs.c |
21 | +++ b/drivers/gpu/drm/imagination/pvr_debugfs.c | 25 | +++ b/drivers/gpu/drm/imagination/pvr_debugfs.c |
... | ... | ||
72 | + for (u32 entry = 0; entry < num_layout_entries; entry++) { | 76 | + for (u32 entry = 0; entry < num_layout_entries; entry++) { |
73 | if (layout_entries[entry].id == META_PRIVATE_DATA || | 77 | if (layout_entries[entry].id == META_PRIVATE_DATA || |
74 | layout_entries[entry].id == MIPS_PRIVATE_DATA || | 78 | layout_entries[entry].id == MIPS_PRIVATE_DATA || |
75 | layout_entries[entry].id == RISCV_PRIVATE_DATA) | 79 | layout_entries[entry].id == RISCV_PRIVATE_DATA) |
76 | @@ -XXX,XX +XXX,XX @@ pvr_fw_validate(struct pvr_device *pvr_dev) | 80 | @@ -XXX,XX +XXX,XX @@ pvr_fw_validate(struct pvr_device *pvr_dev) |
81 | const u8 *fw = firmware->data; | ||
82 | u32 fw_offset = firmware->size - SZ_4K; | ||
83 | u32 layout_table_size; | ||
84 | - u32 entry; | ||
85 | |||
86 | if (firmware->size < SZ_4K || (firmware->size % FW_BLOCK_SIZE)) | ||
77 | return -EINVAL; | 87 | return -EINVAL; |
88 | @@ -XXX,XX +XXX,XX @@ pvr_fw_validate(struct pvr_device *pvr_dev) | ||
89 | return -EINVAL; | ||
78 | 90 | ||
79 | layout_entries = (const struct pvr_fw_layout_entry *)&fw[fw_offset]; | 91 | layout_entries = (const struct pvr_fw_layout_entry *)&fw[fw_offset]; |
80 | - for (entry = 0; entry < header->layout_entry_num; entry++) { | 92 | - for (entry = 0; entry < header->layout_entry_num; entry++) { |
81 | + for (u32 entry = 0; entry < header->layout_entry_num; entry++) { | 93 | + for (u32 entry = 0; entry < header->layout_entry_num; entry++) { |
82 | u32 start_addr = layout_entries[entry].base_addr; | 94 | u32 start_addr = layout_entries[entry].base_addr; |
... | ... | diff view generated by jsdifflib |