On Wed Sep 30 14:41:26 2026 +0800, Hermes Wu wrote:
> s_fsid_map in get_audio_sampling_rate() is a fixed lookup table
> rebuilt on the stack on every call; make it static const so it's
> emitted once as read-only data instead. While touching this
> declaration, move it ahead of the plain int locals per reverse
> fir-tree ordering.
>
> Signed-off-by: Hermes Wu <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>
Patch committed.
Thanks,
Hans Verkuil
drivers/media/i2c/it6625.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/drivers/media/i2c/it6625.c b/drivers/media/i2c/it6625.c
index 5b774eaf5b4e..eaf8f939a0a4 100644
--- a/drivers/media/i2c/it6625.c
+++ b/drivers/media/i2c/it6625.c
@@ -586,9 +586,7 @@ static inline bool audio_present(struct it6625 *it6625)
static int get_audio_sampling_rate(struct it6625 *it6625)
{
- int fs_id;
- int i, freq = 0;
- const struct fs_id_map {
+ static const struct fs_id_map {
u8 fs_id;
u32 freq;
} s_fsid_map[] = {
@@ -613,6 +611,8 @@ static int get_audio_sampling_rate(struct it6625 *it6625)
{ AUD1411K, 1411200 },
{ AUD1536K, 1536000 },
};
+ int fs_id;
+ int i, freq = 0;
if (no_signal(it6625) || !audio_present(it6625))
return 0;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]