]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commit
regmap: debugfs: Don't bother actually printing when calculating max length
authorMark Brown <broonie@kernel.org>
Sat, 19 Sep 2015 14:12:34 +0000 (07:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:39:20 +0000 (14:39 -0700)
commitb1cb6a5ad95be4e1087c421174de35a25095ad66
tree1581b6bff253a7b732f335bcf1732a35bc2d7f5c
parent3c3455972d3a9d2a5030a59b9e65eea3f7b9c9dc
regmap: debugfs: Don't bother actually printing when calculating max length

commit 176fc2d5770a0990eebff903ba680d2edd32e718 upstream.

The in kernel snprintf() will conveniently return the actual length of
the printed string even if not given an output beffer at all so just do
that rather than relying on the user to pass in a suitable buffer,
ensuring that we don't need to worry if the buffer was truncated due to
the size of the buffer passed in.

Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/regmap/regmap-debugfs.c