diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-04-10 07:14:17 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-04-10 12:15:29 -0400 |
commit | 2184b3d69b961b5beb2781acf200b5b93643e32a (patch) | |
tree | aea2a19ec91b0583d53c742a32260a241fe1a931 | |
parent | 3834dc1f0e57891a398b2cabd40c60fa9595cd7c (diff) |
drm/i915/guc: Replace %phn with %ph
%phn is not a valid specifier, and the trailing 'n' is being eaten by
the format-specifier and defaulting to the ' ' separator. Avoid angering
smatch by using the unknown specifier, and use the default we expect.
drivers/gpu/drm/i915/intel_guc_ct.c:616 ctb_read() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:616 ctb_read() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:616 ctb_read() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:669 ct_handle_response() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:679 ct_handle_response() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:693 ct_handle_response() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:707 ct_handle_response() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:727 ct_process_request() warn: '%ph' cannot be followed by 'n'
drivers/gpu/drm/i915/intel_guc_ct.c:803 ct_handle_request() warn: '%ph' cannot be followed by 'n'
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180410111417.27563-1-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/intel_guc_ct.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c index 990141d5f195..371b6005954a 100644 --- a/drivers/gpu/drm/i915/intel_guc_ct.c +++ b/drivers/gpu/drm/i915/intel_guc_ct.c | |||
@@ -361,7 +361,7 @@ static int ctb_write(struct intel_guc_ct_buffer *ctb, | |||
361 | (want_response ? GUC_CT_MSG_SEND_STATUS : 0) | | 361 | (want_response ? GUC_CT_MSG_SEND_STATUS : 0) | |
362 | (action[0] << GUC_CT_MSG_ACTION_SHIFT); | 362 | (action[0] << GUC_CT_MSG_ACTION_SHIFT); |
363 | 363 | ||
364 | CT_DEBUG_DRIVER("CT: writing %*phn %*phn %*phn\n", | 364 | CT_DEBUG_DRIVER("CT: writing %*ph %*ph %*ph\n", |
365 | 4, &header, 4, &fence, | 365 | 4, &header, 4, &fence, |
366 | 4 * (len - 1), &action[1]); | 366 | 4 * (len - 1), &action[1]); |
367 | 367 | ||
@@ -613,7 +613,7 @@ static int ctb_read(struct intel_guc_ct_buffer *ctb, u32 *data) | |||
613 | /* message len with header */ | 613 | /* message len with header */ |
614 | len = ct_header_get_len(data[0]) + 1; | 614 | len = ct_header_get_len(data[0]) + 1; |
615 | if (unlikely(len > (u32)available)) { | 615 | if (unlikely(len > (u32)available)) { |
616 | DRM_ERROR("CT: incomplete message %*phn %*phn %*phn\n", | 616 | DRM_ERROR("CT: incomplete message %*ph %*ph %*ph\n", |
617 | 4, data, | 617 | 4, data, |
618 | 4 * (head + available - 1 > size ? | 618 | 4 * (head + available - 1 > size ? |
619 | size - head : available - 1), &cmds[head], | 619 | size - head : available - 1), &cmds[head], |
@@ -626,7 +626,7 @@ static int ctb_read(struct intel_guc_ct_buffer *ctb, u32 *data) | |||
626 | data[i] = cmds[head]; | 626 | data[i] = cmds[head]; |
627 | head = (head + 1) % size; | 627 | head = (head + 1) % size; |
628 | } | 628 | } |
629 | CT_DEBUG_DRIVER("CT: received %*phn\n", 4 * len, data); | 629 | CT_DEBUG_DRIVER("CT: received %*ph\n", 4 * len, data); |
630 | 630 | ||
631 | desc->head = head * 4; | 631 | desc->head = head * 4; |
632 | return 0; | 632 | return 0; |
@@ -666,7 +666,7 @@ static int ct_handle_response(struct intel_guc_ct *ct, const u32 *msg) | |||
666 | 666 | ||
667 | /* Response payload shall at least include fence and status */ | 667 | /* Response payload shall at least include fence and status */ |
668 | if (unlikely(len < 2)) { | 668 | if (unlikely(len < 2)) { |
669 | DRM_ERROR("CT: corrupted response %*phn\n", 4 * msglen, msg); | 669 | DRM_ERROR("CT: corrupted response %*ph\n", 4 * msglen, msg); |
670 | return -EPROTO; | 670 | return -EPROTO; |
671 | } | 671 | } |
672 | 672 | ||
@@ -676,7 +676,7 @@ static int ct_handle_response(struct intel_guc_ct *ct, const u32 *msg) | |||
676 | 676 | ||
677 | /* Format of the status follows RESPONSE message */ | 677 | /* Format of the status follows RESPONSE message */ |
678 | if (unlikely(!INTEL_GUC_MSG_IS_RESPONSE(status))) { | 678 | if (unlikely(!INTEL_GUC_MSG_IS_RESPONSE(status))) { |
679 | DRM_ERROR("CT: corrupted response %*phn\n", 4 * msglen, msg); | 679 | DRM_ERROR("CT: corrupted response %*ph\n", 4 * msglen, msg); |
680 | return -EPROTO; | 680 | return -EPROTO; |
681 | } | 681 | } |
682 | 682 | ||
@@ -690,7 +690,7 @@ static int ct_handle_response(struct intel_guc_ct *ct, const u32 *msg) | |||
690 | continue; | 690 | continue; |
691 | } | 691 | } |
692 | if (unlikely(datalen > req->response_len)) { | 692 | if (unlikely(datalen > req->response_len)) { |
693 | DRM_ERROR("CT: response %u too long %*phn\n", | 693 | DRM_ERROR("CT: response %u too long %*ph\n", |
694 | req->fence, 4 * msglen, msg); | 694 | req->fence, 4 * msglen, msg); |
695 | datalen = 0; | 695 | datalen = 0; |
696 | } | 696 | } |
@@ -704,7 +704,7 @@ static int ct_handle_response(struct intel_guc_ct *ct, const u32 *msg) | |||
704 | spin_unlock(&ct->lock); | 704 | spin_unlock(&ct->lock); |
705 | 705 | ||
706 | if (!found) | 706 | if (!found) |
707 | DRM_ERROR("CT: unsolicited response %*phn\n", 4 * msglen, msg); | 707 | DRM_ERROR("CT: unsolicited response %*ph\n", 4 * msglen, msg); |
708 | return 0; | 708 | return 0; |
709 | } | 709 | } |
710 | 710 | ||
@@ -713,7 +713,7 @@ static void ct_process_request(struct intel_guc_ct *ct, | |||
713 | { | 713 | { |
714 | struct intel_guc *guc = ct_to_guc(ct); | 714 | struct intel_guc *guc = ct_to_guc(ct); |
715 | 715 | ||
716 | CT_DEBUG_DRIVER("CT: request %x %*phn\n", action, 4 * len, payload); | 716 | CT_DEBUG_DRIVER("CT: request %x %*ph\n", action, 4 * len, payload); |
717 | 717 | ||
718 | switch (action) { | 718 | switch (action) { |
719 | case INTEL_GUC_ACTION_DEFAULT: | 719 | case INTEL_GUC_ACTION_DEFAULT: |
@@ -724,7 +724,7 @@ static void ct_process_request(struct intel_guc_ct *ct, | |||
724 | 724 | ||
725 | default: | 725 | default: |
726 | fail_unexpected: | 726 | fail_unexpected: |
727 | DRM_ERROR("CT: unexpected request %x %*phn\n", | 727 | DRM_ERROR("CT: unexpected request %x %*ph\n", |
728 | action, 4 * len, payload); | 728 | action, 4 * len, payload); |
729 | break; | 729 | break; |
730 | } | 730 | } |
@@ -800,7 +800,7 @@ static int ct_handle_request(struct intel_guc_ct *ct, const u32 *msg) | |||
800 | 800 | ||
801 | request = kmalloc(sizeof(*request) + 4 * msglen, GFP_ATOMIC); | 801 | request = kmalloc(sizeof(*request) + 4 * msglen, GFP_ATOMIC); |
802 | if (unlikely(!request)) { | 802 | if (unlikely(!request)) { |
803 | DRM_ERROR("CT: dropping request %*phn\n", 4 * msglen, msg); | 803 | DRM_ERROR("CT: dropping request %*ph\n", 4 * msglen, msg); |
804 | return 0; /* XXX: -ENOMEM ? */ | 804 | return 0; /* XXX: -ENOMEM ? */ |
805 | } | 805 | } |
806 | memcpy(request->msg, msg, 4 * msglen); | 806 | memcpy(request->msg, msg, 4 * msglen); |