From 304907852ab6f744bbf13c332677d8c75d746bb0 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Mon, 19 Aug 2024 12:48:16 +0300 Subject: [PATCH] techpack: display: Fix misleading indentation Change-Id: I4fbaf1d15d54e5013adfdb1f142d645acc457c83 Signed-off-by: Sevenrock --- techpack/display/msm/sde/sde_motUtil.c | 37 +++++++++++++------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/techpack/display/msm/sde/sde_motUtil.c b/techpack/display/msm/sde/sde_motUtil.c index dc8c00979a20..0f3a08ae6d34 100644 --- a/techpack/display/msm/sde/sde_motUtil.c +++ b/techpack/display/msm/sde/sde_motUtil.c @@ -350,7 +350,7 @@ static ssize_t _sde_debugfs_motUtil_dispUtil_read(char *buffer) blen += snprintf((buffer + blen) , 6, "0x%02x ", *motUtil_data.rd_buf++); - blen += snprintf((buffer + blen), 2, "\n"); + blen += snprintf((buffer + blen), 2, "\n"); } else SDE_ERROR("motUtil failed to read from panel\n"); @@ -372,30 +372,29 @@ static ssize_t _sde_debugfs_motUtil_read(struct file *file, "motUtil_status: %d\n", motUtil_data.cmd_status); } else if (motUtil_data.motUtil_type == MOTUTIL_DISP_UTIL) { - blen = _sde_debugfs_motUtil_dispUtil_read(buffer); + blen = _sde_debugfs_motUtil_dispUtil_read(buffer); } else if (motUtil_data.motUtil_type == MOTUTIL_KMS_PROP_TEST) { - blen = snprintf(buffer, 16, "motUtil_read: "); - blen += snprintf((buffer + blen), 12, "0x%08x ", - motUtil_data.val); - blen += snprintf((buffer + blen), 2, "\n"); - } + blen = snprintf(buffer, 16, "motUtil_read: "); + blen += snprintf((buffer + blen), 12, "0x%08x ", + motUtil_data.val); + blen += snprintf((buffer + blen), 2, "\n"); + } + SDE_INFO("%s\n", buffer); - SDE_INFO("%s\n", buffer); + if (blen <= 0) { + SDE_ERROR("snprintf failed, blen %d\n", blen); + return 0; + } - if (blen <= 0) { - SDE_ERROR("snprintf failed, blen %d\n", blen); - return 0; - } + if (copy_to_user(buf, buffer, min(count, (size_t)blen+1))) { + SDE_ERROR("copy to user buffer failed\n"); + return -EFAULT; + } - if (copy_to_user(buf, buffer, min(count, (size_t)blen+1))) { - SDE_ERROR("copy to user buffer failed\n"); - return -EFAULT; - } - - *ppos += blen; + *ppos += blen; mutex_unlock(&motUtil_data.lock); - return blen; + return blen; } static const struct file_operations sde_debugfs_motUtil_fops = {