Skip to content

Commit 3aa8725

Browse files
committed
OPP: debugfs: Fix warning with W=1 builds
We currently get the following warning: debugfs.c: In function ‘opp_debug_create_one’: debugfs.c:63:42: warning: ‘%.1d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] snprintf(name, sizeof(name), "icc-path-%.1d", i); ^~~~ debugfs.c:63:32: note: directive argument in the range [0, 2147483647] snprintf(name, sizeof(name), "icc-path-%.1d", i); ^~~~~~~~~~~~~~~ debugfs.c:63:3: note: ‘snprintf’ output between 11 and 20 bytes into a destination of size 11 snprintf(name, sizeof(name), "icc-path-%.1d", i); Fix it by increasing size of the `name` array. Signed-off-by: Viresh Kumar <[email protected]>
1 parent cca14de commit 3aa8725

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/opp/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static void opp_debug_create_bw(struct dev_pm_opp *opp,
5656
struct dentry *pdentry)
5757
{
5858
struct dentry *d;
59-
char name[11];
59+
char name[20];
6060
int i;
6161

6262
for (i = 0; i < opp_table->path_count; i++) {

0 commit comments

Comments
 (0)