Commit bec7d24f547fb4f8bb42cb2da81cdb54459f9c17
1 parent
5c98a1bf
Remove duplicate counter in read_io_status()
Showing
1 changed file
with
1 additions
and
3 deletions
modbus/modbus.c
| ... | ... | @@ -978,7 +978,6 @@ static int read_io_status(modbus_param_t *mb_param, int slave, int function, |
| 978 | 978 | if (ret > 0) { |
| 979 | 979 | int i, temp, bit; |
| 980 | 980 | int pos = 0; |
| 981 | - int processed = 0; | |
| 982 | 981 | int offset; |
| 983 | 982 | int offset_length; |
| 984 | 983 | |
| ... | ... | @@ -993,9 +992,8 @@ static int read_io_status(modbus_param_t *mb_param, int slave, int function, |
| 993 | 992 | /* Shift reg hi_byte to temp */ |
| 994 | 993 | temp = response[3 + i]; |
| 995 | 994 | |
| 996 | - for (bit = 0x01; (bit & 0xff) && (processed < nb);) { | |
| 995 | + for (bit = 0x01; (bit & 0xff) && (pos < nb);) { | |
| 997 | 996 | data_dest[pos++] = (temp & bit) ? TRUE : FALSE; |
| 998 | - processed++; | |
| 999 | 997 | bit = bit << 1; |
| 1000 | 998 | } |
| 1001 | 999 | ... | ... |