crypto: qat - fix type mismatch in RAS sysfs show functions
ADF_RAS_ERR_CTR_READ() expands to atomic_read(), which returns int.
The local variable 'counter' was declared as 'unsigned long', causing
a type mismatch on the assignment. The format specifier '%ld' was
consequently wrong in two ways: wrong length modifier and wrong
signedness.
Use int to match the return type of atomic_read() and update the
format specifier to '%d' accordingly.
Fixes: 532d7f6bc4 ("crypto: qat - add error counters")
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>
master
parent
795c24c677
commit
ec23d75c4b
|
|
@ -13,14 +13,14 @@ static ssize_t errors_correctable_show(struct device *dev,
|
|||
char *buf)
|
||||
{
|
||||
struct adf_accel_dev *accel_dev;
|
||||
unsigned long counter;
|
||||
int counter;
|
||||
|
||||
accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
|
||||
if (!accel_dev)
|
||||
return -EINVAL;
|
||||
|
||||
counter = ADF_RAS_ERR_CTR_READ(accel_dev->ras_errors, ADF_RAS_CORR);
|
||||
return scnprintf(buf, PAGE_SIZE, "%ld\n", counter);
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", counter);
|
||||
}
|
||||
|
||||
static ssize_t errors_nonfatal_show(struct device *dev,
|
||||
|
|
@ -28,14 +28,14 @@ static ssize_t errors_nonfatal_show(struct device *dev,
|
|||
char *buf)
|
||||
{
|
||||
struct adf_accel_dev *accel_dev;
|
||||
unsigned long counter;
|
||||
int counter;
|
||||
|
||||
accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
|
||||
if (!accel_dev)
|
||||
return -EINVAL;
|
||||
|
||||
counter = ADF_RAS_ERR_CTR_READ(accel_dev->ras_errors, ADF_RAS_UNCORR);
|
||||
return scnprintf(buf, PAGE_SIZE, "%ld\n", counter);
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", counter);
|
||||
}
|
||||
|
||||
static ssize_t errors_fatal_show(struct device *dev,
|
||||
|
|
@ -43,14 +43,14 @@ static ssize_t errors_fatal_show(struct device *dev,
|
|||
char *buf)
|
||||
{
|
||||
struct adf_accel_dev *accel_dev;
|
||||
unsigned long counter;
|
||||
int counter;
|
||||
|
||||
accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
|
||||
if (!accel_dev)
|
||||
return -EINVAL;
|
||||
|
||||
counter = ADF_RAS_ERR_CTR_READ(accel_dev->ras_errors, ADF_RAS_FATAL);
|
||||
return scnprintf(buf, PAGE_SIZE, "%ld\n", counter);
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", counter);
|
||||
}
|
||||
|
||||
static ssize_t reset_error_counters_store(struct device *dev,
|
||||
|
|
|
|||
Loading…
Reference in New Issue