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)
commitd4556f5e99d5f603913bac01adaff8670cb2d08b
treee851cb5765a585fa0a6075a7d7d310631c54897b
parentfd6988496e79a6a4bdb514a4655d2920209eb85d
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: 1dd62c66d345 ("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