Skip to content

Commit a66cf93

Browse files
aguerinIntelherbertx
authored andcommitted
crypto: qat - remove double initialization of value
Remove double initialization of the reg variable. This is to fix the following warning when compiling the QAT driver using clang scan-build: drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c:1010:6: warning: Value stored to 'reg' during its initialization is never read [deadcode.DeadStores] 1010 | u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SSMCPPERR); | ^~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c:1109:6: warning: Value stored to 'reg' during its initialization is never read [deadcode.DeadStores] 1109 | u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SER_ERR_SSMSH); | ^~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 99b1c98 ("crypto: qat - count QAT GEN4 errors") Signed-off-by: Adam Guerin <adam.guerin@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent f99fb7d commit a66cf93

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,7 @@ static bool adf_handle_spppar_err(struct adf_accel_dev *accel_dev,
10071007
static bool adf_handle_ssmcpppar_err(struct adf_accel_dev *accel_dev,
10081008
void __iomem *csr, u32 iastatssm)
10091009
{
1010-
u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SSMCPPERR);
1011-
u32 bits_num = BITS_PER_REG(reg);
1010+
u32 reg, bits_num = BITS_PER_REG(reg);
10121011
bool reset_required = false;
10131012
unsigned long errs_bits;
10141013
u32 bit_iterator;
@@ -1106,8 +1105,7 @@ static bool adf_handle_rf_parr_err(struct adf_accel_dev *accel_dev,
11061105
static bool adf_handle_ser_err_ssmsh(struct adf_accel_dev *accel_dev,
11071106
void __iomem *csr, u32 iastatssm)
11081107
{
1109-
u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SER_ERR_SSMSH);
1110-
u32 bits_num = BITS_PER_REG(reg);
1108+
u32 reg, bits_num = BITS_PER_REG(reg);
11111109
bool reset_required = false;
11121110
unsigned long errs_bits;
11131111
u32 bit_iterator;

0 commit comments

Comments
 (0)