Skip to contentSkip to conversation

drm/i915/perf: Fix compiler warning for string truncation

PATCH In review Chris Wilson 3 participants 7 messages Feb 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 drm/i915/perf: Fix compiler warning for string truncation

drivers/gpu/drm/i915/i915_oa_cflgt3.c: In function ‘i915_perf_load_test_config_cflgt3’:
drivers/gpu/drm/i915/i915_oa_cflgt3.c:87:2: error: ‘strncpy’ output truncated before terminating nul copying 36 bytes from a string of the same length [-Werror=stringop-truncation]

v2: strlcpy

Fixes 4407eaa9b0cc ("drm/i915/perf: add support for Coffeelake GT3")
Cc Lionel Landwerlin <[email protected]>
Cc Matthew Auld <[email protected]>
---
 drivers/gpu/drm/i915/i915_oa_cflgt3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_oa_cflgt3.c +2 -2
index 42ff06fe54a3..792facdb6702 100644
@@ -84,9 +84,9 @@ show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf)
 void
 i915_perf_load_test_config_cflgt3(struct drm_i915_private *dev_priv)
 {
-	strncpy(dev_priv->perf.oa.test_config.uuid,
+	strlcpy(dev_priv->perf.oa.test_config.uuid,
 		"577e8e2c-3fa0-4875-8743-3538d585e3b0",
-		UUID_STRING_LEN);
+		sizeof(dev_priv->perf.oa.test_config.uuid));
 	dev_priv->perf.oa.test_config.id = 1;
 
 	dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
Signature · 6 lines
2.16.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v2 2/2 drm/i915/perf: Fix compiler warning for string truncation

drivers/gpu/drm/i915/i915_oa_cnl.c: In function ‘i915_perf_load_test_config_cnl’:
drivers/gpu/drm/i915/i915_oa_cnl.c:99:2: error: ‘strncpy’ output truncated before terminating nul copying 36 bytes from a string of the same length [-Werror=stringop-truncation]

v2: strlcpy

Fixes 95690a02fb5d ("drm/i915/perf: enable perf support on CNL")
Cc Lionel Landwerlin <[email protected]>
Cc Matthew Auld <[email protected]>
---
 drivers/gpu/drm/i915/i915_oa_cnl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_oa_cnl.c +2 -2
index ff0ac3627cc4..ba9140c87cc0 100644
@@ -96,9 +96,9 @@ show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf)
 void
 i915_perf_load_test_config_cnl(struct drm_i915_private *dev_priv)
 {
-	strncpy(dev_priv->perf.oa.test_config.uuid,
+	strlcpy(dev_priv->perf.oa.test_config.uuid,
 		"db41edd4-d8e7-4730-ad11-b9a2d6833503",
-		UUID_STRING_LEN);
+		sizeof(dev_priv->perf.oa.test_config.uuid));
 	dev_priv->perf.oa.test_config.id = 1;
 
 	dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
Signature · 6 lines
2.16.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 2/2
#2 lore raw
Quoted 9 lines · Chris Wilson

drivers/gpu/drm/i915/i915_oa_cnl.c: In function ‘i915_perf_load_test_config_cnl’:
drivers/gpu/drm/i915/i915_oa_cnl.c:99:2: error: ‘strncpy’ output truncated before terminating nul copying 36 bytes from a string of the same length [-Werror=stringop-truncation]

v2: strlcpy

Fixes 95690a02fb5d ("drm/i915/perf: enable perf support on CNL")
Cc Lionel Landwerlin <[email protected]>
Cc Matthew Auld <[email protected]>
Quoted 10 lines
---
  drivers/gpu/drm/i915/i915_oa_cnl.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_oa_cnl.c +0 -0
index ff0ac3627cc4..ba9140c87cc0 100644
@@ -96,9 +96,9 @@ show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf)
  void

drivers/gpu/drm/i915/i915_oa_cnl.c show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf) · line 104

Quoted 10 lines
drivers/gpu/drm/i915/i915_oa_cnl.c +2 -2
  i915_perf_load_test_config_cnl(struct drm_i915_private *dev_priv)
  {
-	strncpy(dev_priv->perf.oa.test_config.uuid,
+	strlcpy(dev_priv->perf.oa.test_config.uuid,
  		"db41edd4-d8e7-4730-ad11-b9a2d6833503",
-		UUID_STRING_LEN);
+		sizeof(dev_priv->perf.oa.test_config.uuid));
  	dev_priv->perf.oa.test_config.id = 1;
 
  	dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v2 1/2
#3 lore raw
In reply to Chris Wilson
Quoted 8 lines · Chris Wilson

drivers/gpu/drm/i915/i915_oa_cflgt3.c: In function ‘i915_perf_load_test_config_cflgt3’:
drivers/gpu/drm/i915/i915_oa_cflgt3.c:87:2: error: ‘strncpy’ output truncated before terminating nul copying 36 bytes from a string of the same length [-Werror=stringop-truncation]

v2: strlcpy

Fixes 4407eaa9b0cc ("drm/i915/perf: add support for Coffeelake GT3")
Cc Lionel Landwerlin <[email protected]>
Quoted 11 lines
Cc Matthew Auld <[email protected]>
---
  drivers/gpu/drm/i915/i915_oa_cflgt3.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_oa_cflgt3.c +0 -0
index 42ff06fe54a3..792facdb6702 100644
@@ -84,9 +84,9 @@ show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf)
  void

drivers/gpu/drm/i915/i915_oa_cflgt3.c show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf) · line 92

Quoted 10 lines
drivers/gpu/drm/i915/i915_oa_cflgt3.c +2 -2
  i915_perf_load_test_config_cflgt3(struct drm_i915_private *dev_priv)
  {
-	strncpy(dev_priv->perf.oa.test_config.uuid,
+	strlcpy(dev_priv->perf.oa.test_config.uuid,
  		"577e8e2c-3fa0-4875-8743-3538d585e3b0",
-		UUID_STRING_LEN);
+		sizeof(dev_priv->perf.oa.test_config.uuid));
  	dev_priv->perf.oa.test_config.id = 1;
 
  	dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation
URL : https://patchwork.freedesktop.org/series/37892/
State : success

== Summary ==

Series 37892v1 series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation
https://patchwork.freedesktop.org/api/1.0/series/37892/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:417s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:430s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:377s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:480s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:467s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:575s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:411s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:283s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:387s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:412s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:458s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:414s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:458s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:495s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:454s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:498s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:599s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:508s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:526s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:490s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:480s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:414s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:430s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:516s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:400s

Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:465s

02138262c598ebb87d101d44170c9292ed753313 drm-tip: 2018y-02m-08d-09h-37m-41s UTC integration manifest 382c132140dc drm/i915/perf: Fix compiler warning for string truncation
f584e4c1d7b0 drm/i915/perf: Fix compiler warning for string truncation

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7943/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Re: ✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation

Quoting Patchwork (2018-02-08 11:05:25)

Quoted 6 lines

== Series Details ==

Series: series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation
URL : https://patchwork.freedesktop.org/series/37892/
State : success

Quoted 8 lines

== Summary ==

Series 37892v1 series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation
https://patchwork.freedesktop.org/api/1.0/series/37892/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

And pushed the trivial warning cleanup. Thanks,
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

✓ Fi.CI.IGT: success for series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: series starting with [v2,1/2] drm/i915/perf: Fix compiler warning for string truncation
URL : https://patchwork.freedesktop.org/series/37892/
State : success

== Summary ==

Test gem_exec_suspend:

        Subgroup basic-s4:
                skip       -> FAIL       (shard-snb) fdo#103375
        Subgroup basic-s4-devices:
                pass       -> INCOMPLETE (shard-hsw) fdo#104874
Test kms_flip:
        Subgroup 2x-flip-vs-expired-vblank:
                fail       -> PASS       (shard-hsw) fdo#102887
Test gem_eio:
        Subgroup in-flight-contexts:
                fail       -> PASS       (shard-hsw) fdo#104676

fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#104874 https://bugs.freedesktop.org/show_bug.cgi?id=104874
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676

shard-hsw        total:3355 pass:1720 dwarn:1   dfail:0   fail:10  skip:1622 time:11362s
shard-snb        total:3444 pass:1349 dwarn:1   dfail:0   fail:10  skip:2084 time:6538s

Blacklisted hosts:
shard-kbl total:3380 pass:1878 dwarn:1 dfail:0 fail:21 skip:1479 time:9454s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7943/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx