diff mbox series

drm/komeda: convert sysfs sprintf/snprintf family to sysfs_emit

Message ID 1612420708-25297-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series drm/komeda: convert sysfs sprintf/snprintf family to sysfs_emit | expand

Commit Message

Jiapeng Chong Feb. 4, 2021, 6:38 a.m. UTC
Fix the following coccicheck warning:

./drivers/gpu/drm/arm/display/komeda/komeda_dev.c:97:8-16: WARNING: use
scnprintf or sprintf.

./drivers/gpu/drm/arm/display/komeda/komeda_dev.c:88:8-16: WARNING: use
scnprintf or sprintf.

./drivers/gpu/drm/arm/display/komeda/komeda_dev.c:65:8-16: WARNING: use
scnprintf or sprintf.

Reported-by: Abaci Robot<abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

James Qian Wang Feb. 5, 2021, 8:56 a.m. UTC | #1
On Thu, Feb 04, 2021 at 02:38:28PM +0800, Jiapeng Chong wrote:
> Fix the following coccicheck warning:
> 
> ./drivers/gpu/drm/arm/display/komeda/komeda_dev.c:97:8-16: WARNING: use
> scnprintf or sprintf.
> 
> ./drivers/gpu/drm/arm/display/komeda/komeda_dev.c:88:8-16: WARNING: use
> scnprintf or sprintf.
> 
> ./drivers/gpu/drm/arm/display/komeda/komeda_dev.c:65:8-16: WARNING: use
> scnprintf or sprintf.
> 
> Reported-by: Abaci Robot<abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---

Looks good to me, thank you for the patch.

Reviewed-by: James Qian Wang <james.qian.wang@arm.com>

>  drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> index ca891ae..cc7664c 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> @@ -62,7 +62,7 @@ static void komeda_debugfs_init(struct komeda_dev *mdev)
>  {
>  	struct komeda_dev *mdev = dev_to_mdev(dev);
>  
> -	return snprintf(buf, PAGE_SIZE, "0x%08x\n", mdev->chip.core_id);
> +	return sysfs_emit(buf, "0x%08x\n", mdev->chip.core_id);
>  }
>  static DEVICE_ATTR_RO(core_id);
>  
> @@ -85,7 +85,7 @@ static void komeda_debugfs_init(struct komeda_dev *mdev)
>  		if (pipe->layers[i]->layer_type == KOMEDA_FMT_RICH_LAYER)
>  			config_id.n_richs++;
>  	}
> -	return snprintf(buf, PAGE_SIZE, "0x%08x\n", config_id.value);
> +	return sysfs_emit(buf, "0x%08x\n", config_id.value);
>  }
>  static DEVICE_ATTR_RO(config_id);
>  
> @@ -94,7 +94,7 @@ static void komeda_debugfs_init(struct komeda_dev *mdev)
>  {
>  	struct komeda_dev *mdev = dev_to_mdev(dev);
>  
> -	return snprintf(buf, PAGE_SIZE, "%lu\n", clk_get_rate(mdev->aclk));
> +	return sysfs_emit(buf, "%lu\n", clk_get_rate(mdev->aclk));
>  }
>  static DEVICE_ATTR_RO(aclk_hz);
>  
> -- 
> 1.8.3.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
index ca891ae..cc7664c 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
@@ -62,7 +62,7 @@  static void komeda_debugfs_init(struct komeda_dev *mdev)
 {
 	struct komeda_dev *mdev = dev_to_mdev(dev);
 
-	return snprintf(buf, PAGE_SIZE, "0x%08x\n", mdev->chip.core_id);
+	return sysfs_emit(buf, "0x%08x\n", mdev->chip.core_id);
 }
 static DEVICE_ATTR_RO(core_id);
 
@@ -85,7 +85,7 @@  static void komeda_debugfs_init(struct komeda_dev *mdev)
 		if (pipe->layers[i]->layer_type == KOMEDA_FMT_RICH_LAYER)
 			config_id.n_richs++;
 	}
-	return snprintf(buf, PAGE_SIZE, "0x%08x\n", config_id.value);
+	return sysfs_emit(buf, "0x%08x\n", config_id.value);
 }
 static DEVICE_ATTR_RO(config_id);
 
@@ -94,7 +94,7 @@  static void komeda_debugfs_init(struct komeda_dev *mdev)
 {
 	struct komeda_dev *mdev = dev_to_mdev(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%lu\n", clk_get_rate(mdev->aclk));
+	return sysfs_emit(buf, "%lu\n", clk_get_rate(mdev->aclk));
 }
 static DEVICE_ATTR_RO(aclk_hz);