media: cec.h: increase input_phys buffer
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 23 Sep 2023 15:20:52 +0000 (17:20 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 27 Sep 2023 08:47:22 +0000 (10:47 +0200)
Fixes this compiler warning:

drivers/media/cec/core/cec-core.c: In function 'cec_allocate_adapter':
drivers/media/cec/core/cec-core.c:317:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
  317 |                  "%s/input0", adap->name);
      |                     ^~~~~~~
drivers/media/cec/core/cec-core.c:316:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
  316 |         snprintf(adap->input_phys, sizeof(adap->input_phys),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  317 |                  "%s/input0", adap->name);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
include/media/cec.h

index 9c007f83569aafb504a97a7ab834525185307c9b..53e4b2eb2b260941a487ff8da208e57203ae234a 100644 (file)
@@ -275,7 +275,7 @@ struct cec_adapter {
 
        u32 sequence;
 
-       char input_phys[32];
+       char input_phys[40];
 };
 
 static inline void *cec_get_drvdata(const struct cec_adapter *adap)