mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
crypto: qat - replace scnprintf() with sysfs_emit()
Replace scnprintf() with sysfs_emit() in the three RAS error counter sysfs show callbacks. sysfs_emit() is the recommended API for sysfs show functions as per Documentation/filesystems/sysfs.rst; it enforces the PAGE_SIZE limit implicitly, removing the need to pass it explicitly. Signed-off-by: Atharv Dubey <atharvd440@gmail.com> Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Ahsan Atta <ahsan.atta@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -20,7 +20,7 @@ static ssize_t errors_correctable_show(struct device *dev,
|
||||
return -EINVAL;
|
||||
|
||||
counter = ADF_RAS_ERR_CTR_READ(accel_dev->ras_errors, ADF_RAS_CORR);
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", counter);
|
||||
return sysfs_emit(buf, "%d\n", counter);
|
||||
}
|
||||
|
||||
static ssize_t errors_nonfatal_show(struct device *dev,
|
||||
@@ -35,7 +35,7 @@ static ssize_t errors_nonfatal_show(struct device *dev,
|
||||
return -EINVAL;
|
||||
|
||||
counter = ADF_RAS_ERR_CTR_READ(accel_dev->ras_errors, ADF_RAS_UNCORR);
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", counter);
|
||||
return sysfs_emit(buf, "%d\n", counter);
|
||||
}
|
||||
|
||||
static ssize_t errors_fatal_show(struct device *dev,
|
||||
@@ -50,7 +50,7 @@ static ssize_t errors_fatal_show(struct device *dev,
|
||||
return -EINVAL;
|
||||
|
||||
counter = ADF_RAS_ERR_CTR_READ(accel_dev->ras_errors, ADF_RAS_FATAL);
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", counter);
|
||||
return sysfs_emit(buf, "%d\n", counter);
|
||||
}
|
||||
|
||||
static ssize_t reset_error_counters_store(struct device *dev,
|
||||
|
||||
Reference in New Issue
Block a user