]> git.baikalelectronics.ru Git - kernel.git/commit
PM / devfreq: exynos-ppmu: Fix excessive stack usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 22 Oct 2019 14:26:48 +0000 (16:26 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 30 Dec 2019 00:59:04 +0000 (09:59 +0900)
commite6be86146c5bef8239faf135329a9e8c109e932d
treee851cb5765a585fa0a6075a7d7d310631c54897b
parenta703976d8e9b2972343d7af9d551c41c680d9d84
PM / devfreq: exynos-ppmu: Fix excessive stack usage

Putting a 'struct devfreq_event_dev' object on the stack is generally
a bad idea and here it leads to a warnig about potential stack overflow:

drivers/devfreq/event/exynos-ppmu.c:643:12: error: stack frame size of 1040 bytes in function 'exynos_ppmu_probe' [-Werror,-Wframe-larger-than=]

There is no real need for the device structure, only the string inside
it, so add an internal helper function that simply takes the string
as its argument and remove the device structure.

Fixes: f4d20ad9fe75 ("PM / devfreq: events: extend events by type of counted data")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[cw00.choi: Fix the issue from 'desc->name' to 'desc[j].name']
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/event/exynos-ppmu.c