Fix cppcheck style: scope of variable can be reduced

Fix the following cppcheck warnings:
[libnfc/drivers/pn532_uart.c:492]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:320]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:616]: (style) The scope of the variable 'res' can be reduced
[libnfc/nfc.c:356]: (style) The scope of the variable '_device_found' can be reduced
[utils/nfc-mfclassic.c:178]: (style) The scope of the variable 'key_index' can be reduced
This commit is contained in:
Philippe Teuwen 2013-03-06 00:35:36 +01:00
parent 3f5a3fd58f
commit 4769392157
4 changed files with 5 additions and 7 deletions

View file

@ -317,9 +317,9 @@ pn53x_set_parameters(struct nfc_device *pnd, const uint8_t ui8Parameter, const b
int
pn53x_set_tx_bits(struct nfc_device *pnd, const uint8_t ui8Bits)
{
int res = 0;
// Test if we need to update the transmission bits register setting
if (CHIP_DATA(pnd)->ui8TxBits != ui8Bits) {
int res = 0;
// Set the amount of transmission bits in the PN53X chip register
if ((res = pn53x_write_register(pnd, PN53X_REG_CIU_BitFraming, SYMBOL_TX_LAST_BITS, ui8Bits)) < 0)
return res;
@ -613,8 +613,8 @@ pn53x_WriteRegister(struct nfc_device *pnd, const uint16_t ui16RegisterAddress,
int
pn53x_write_register(struct nfc_device *pnd, const uint16_t ui16RegisterAddress, const uint8_t ui8SymbolMask, const uint8_t ui8Value)
{
int res = 0;
if ((ui16RegisterAddress < PN53X_CACHE_REGISTER_MIN_ADDRESS) || (ui16RegisterAddress > PN53X_CACHE_REGISTER_MAX_ADDRESS)) {
int res = 0;
// Direct write
if (ui8SymbolMask != 0xff) {
uint8_t ui8CurrentValue;