diff mbox

drm: don't push static constants on stack for %*ph

Message ID 1375441764-13720-1-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Shevchenko Aug. 2, 2013, 11:09 a.m. UTC
There is no need to pass constants via stack. The width may be explicitly
specified in the format.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/nouveau/core/engine/disp/dport.c | 2 +-
 drivers/gpu/drm/radeon/atombios_dp.c             | 2 +-
 drivers/gpu/drm/udl/udl_main.c                   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

David Herrmann Aug. 2, 2013, 4:19 p.m. UTC | #1
Hi

On Fri, Aug 2, 2013 at 1:09 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> There is no need to pass constants via stack. The width may be explicitly
> specified in the format.

Yupp, all 3 make sense and actually speed up "format_decode()".
  Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Regards
David

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpu/drm/nouveau/core/engine/disp/dport.c | 2 +-
>  drivers/gpu/drm/radeon/atombios_dp.c             | 2 +-
>  drivers/gpu/drm/udl/udl_main.c                   | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
> index 31cc8fe..054d9cf 100644
> --- a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
> +++ b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
> @@ -150,7 +150,7 @@ dp_link_train_update(struct dp_state *dp, u32 delay)
>         if (ret)
>                 return ret;
>
> -       DBG("status %*ph\n", 6, dp->stat);
> +       DBG("status %6ph\n", dp->stat);
>         return 0;
>  }
>
> diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
> index 32501f6..3569d89 100644
> --- a/drivers/gpu/drm/radeon/atombios_dp.c
> +++ b/drivers/gpu/drm/radeon/atombios_dp.c
> @@ -585,7 +585,7 @@ static bool radeon_dp_get_link_status(struct radeon_connector *radeon_connector,
>                 return false;
>         }
>
> -       DRM_DEBUG_KMS("link status %*ph\n", 6, link_status);
> +       DRM_DEBUG_KMS("link status %6ph\n", link_status);
>         return true;
>  }
>
> diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
> index 0ce2d71..f5ae574 100644
> --- a/drivers/gpu/drm/udl/udl_main.c
> +++ b/drivers/gpu/drm/udl/udl_main.c
> @@ -41,8 +41,8 @@ static int udl_parse_vendor_descriptor(struct drm_device *dev,
>         total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */
>                                     0, desc, MAX_VENDOR_DESCRIPTOR_SIZE);
>         if (total_len > 5) {
> -               DRM_INFO("vendor descriptor length:%x data:%*ph\n",
> -                       total_len, 11, desc);
> +               DRM_INFO("vendor descriptor length:%x data:%11ph\n",
> +                       total_len, desc);
>
>                 if ((desc[0] != total_len) || /* descriptor length */
>                     (desc[1] != 0x5f) ||   /* vendor descriptor type */
> --
> 1.8.4.rc0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
index 31cc8fe..054d9cf 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
@@ -150,7 +150,7 @@  dp_link_train_update(struct dp_state *dp, u32 delay)
 	if (ret)
 		return ret;
 
-	DBG("status %*ph\n", 6, dp->stat);
+	DBG("status %6ph\n", dp->stat);
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
index 32501f6..3569d89 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -585,7 +585,7 @@  static bool radeon_dp_get_link_status(struct radeon_connector *radeon_connector,
 		return false;
 	}
 
-	DRM_DEBUG_KMS("link status %*ph\n", 6, link_status);
+	DRM_DEBUG_KMS("link status %6ph\n", link_status);
 	return true;
 }
 
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index 0ce2d71..f5ae574 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -41,8 +41,8 @@  static int udl_parse_vendor_descriptor(struct drm_device *dev,
 	total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */
 				    0, desc, MAX_VENDOR_DESCRIPTOR_SIZE);
 	if (total_len > 5) {
-		DRM_INFO("vendor descriptor length:%x data:%*ph\n",
-			total_len, 11, desc);
+		DRM_INFO("vendor descriptor length:%x data:%11ph\n",
+			total_len, desc);
 
 		if ((desc[0] != total_len) || /* descriptor length */
 		    (desc[1] != 0x5f) ||   /* vendor descriptor type */