]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc: Use snprintf to construct DSCR sysfs interface paths
authorSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 13:34:26 +0000 (09:34 -0400)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 6 Oct 2017 09:51:10 +0000 (20:51 +1100)
commitfea544dca846a8c28cf64461f1f27755246218d3
tree62c6f08d3b7b9b3091940eea17a7bd82cfaa44c7
parent60c060eff59921e4aa5a836132dfa75727d7880b
selftests/powerpc: Use snprintf to construct DSCR sysfs interface paths

Currently sprintf is used, and while paths should never exceed
the size of the buffer it is theoretically possible since
dirent.d_name is 256 bytes. As a result this trips
-Wformat-overflow, and since the test is built with -Wall -Werror
the causes the build to fail. Switch to using snprintf and skip
any paths which are too long for the filename buffer.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c