mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
tftp.c (rx_callback): simplify expressions containing unnecessary casts
This commit is contained in:
parent
36613c7955
commit
e0e447f0e0
1 changed files with 2 additions and 2 deletions
|
@ -55,8 +55,8 @@ static void rx_callback(unsigned int src_ip, unsigned short src_port,
|
|||
|
||||
if(length < 4) return;
|
||||
if(dst_port != PORT_IN) return;
|
||||
opcode = ((unsigned short)(data[0]) << 8)|((unsigned short)(data[1]));
|
||||
block = ((unsigned short)(data[2]) << 8)|((unsigned short)(data[3]));
|
||||
opcode = data[0] << 8 | data[1];
|
||||
block = data[2] << 8 | data[3];
|
||||
if(block < 1) return;
|
||||
if(opcode == TFTP_DATA) { /* Data */
|
||||
length -= 4;
|
||||
|
|
Loading…
Reference in a new issue