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:
Atharv Dubey
2026-03-24 18:17:24 +00:00
committed by Herbert Xu
parent ec23d75c4b
commit 6bd87f2ea5

View File

@@ -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,