diff mbox

[2/4] drm/i915/bios: fix format string of the VBT signature logging

Message ID 1450271061-32646-2-git-send-email-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Dec. 16, 2015, 1:04 p.m. UTC
Specify the maximum number of letters to print from the potentially
unterminated buffer, not the minimum. While at it, use sizeof instead of
a magic number.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_bios.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Chris Wilson Dec. 16, 2015, 2:23 p.m. UTC | #1
On Wed, Dec 16, 2015 at 03:04:19PM +0200, Jani Nikula wrote:
> Specify the maximum number of letters to print from the potentially
> unterminated buffer, not the minimum. While at it, use sizeof instead of
> a magic number.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Wow that's a widely underused feature, only the test code exercises.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Jani Nikula Dec. 16, 2015, 4:10 p.m. UTC | #2
On Wed, 16 Dec 2015, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Wed, Dec 16, 2015 at 03:04:19PM +0200, Jani Nikula wrote:
>> Specify the maximum number of letters to print from the potentially
>> unterminated buffer, not the minimum. While at it, use sizeof instead of
>> a magic number.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Wow that's a widely underused feature, only the test code exercises.

I didn't know it was *that* underused!

All pushed to drm-intel-next-queued, thanks for the review!

BR,
Jani.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index dc3a0fb1946c..4c9304e92ff5 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -1326,8 +1326,8 @@  intel_bios_init(struct drm_device *dev)
 
 	bdb = get_bdb_header(vbt);
 
-	DRM_DEBUG_KMS("VBT signature \"%20s\", BDB version %d\n",
-		      vbt->signature, bdb->version);
+	DRM_DEBUG_KMS("VBT signature \"%.*s\", BDB version %d\n",
+		      (int)sizeof(vbt->signature), vbt->signature, bdb->version);
 
 	/* Grab useful general definitions */
 	parse_general_features(dev_priv, bdb);