aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-09-05 10:47:35 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-09-09 07:03:34 -0400
commit30296f61159e803ba4c35b4bd1a2fef4cdd3a1d4 (patch)
tree5442dc40496a48d7026ba2a3bca2b642c74c91af
parent9c8ee3c7341393811d5be5eb61b815e76f92c799 (diff)
video: fbdev: use %*ph specifier to dump small buffers
Instead of dereference each byte let's use %*ph specifier in the printk() calls. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/fbdev/core/fbsysfs.c12
-rw-r--r--drivers/video/fbdev/udlfb.c7
2 files changed, 4 insertions, 15 deletions
diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
index 53444ac19fe0..60c3f0a16341 100644
--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -485,16 +485,8 @@ static ssize_t show_bl_curve(struct device *device,
485 485
486 mutex_lock(&fb_info->bl_curve_mutex); 486 mutex_lock(&fb_info->bl_curve_mutex);
487 for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) 487 for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
488 len += snprintf(&buf[len], PAGE_SIZE, 488 len += snprintf(&buf[len], PAGE_SIZE, "%8ph\n",
489 "%02x %02x %02x %02x %02x %02x %02x %02x\n", 489 fb_info->bl_curve + i);
490 fb_info->bl_curve[i + 0],
491 fb_info->bl_curve[i + 1],
492 fb_info->bl_curve[i + 2],
493 fb_info->bl_curve[i + 3],
494 fb_info->bl_curve[i + 4],
495 fb_info->bl_curve[i + 5],
496 fb_info->bl_curve[i + 6],
497 fb_info->bl_curve[i + 7]);
498 mutex_unlock(&fb_info->bl_curve_mutex); 490 mutex_unlock(&fb_info->bl_curve_mutex);
499 491
500 return len; 492 return len;
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index 77b890e4d296..046d51d83d74 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1528,11 +1528,8 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
1528 } 1528 }
1529 1529
1530 if (total_len > 5) { 1530 if (total_len > 5) {
1531 pr_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \ 1531 pr_info("vendor descriptor length:%x data:%11ph\n", total_len,
1532 "%02x %02x %02x %02x %02x %02x %02x\n", 1532 desc);
1533 total_len, desc[0],
1534 desc[1], desc[2], desc[3], desc[4], desc[5], desc[6],
1535 desc[7], desc[8], desc[9], desc[10]);
1536 1533
1537 if ((desc[0] != total_len) || /* descriptor length */ 1534 if ((desc[0] != total_len) || /* descriptor length */
1538 (desc[1] != 0x5f) || /* vendor descriptor type */ 1535 (desc[1] != 0x5f) || /* vendor descriptor type */