From: Werner Almesberger Date: Tue, 16 Apr 2013 16:55:22 +0000 (-0300) Subject: tftp.c (rx_callback): simplify expressions containing unnecessary casts X-Git-Tag: 24jan2021_ls180~2980 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0e447f0e06c5133967fcf24873d42bbe5bb5d71;p=litex.git tftp.c (rx_callback): simplify expressions containing unnecessary casts --- diff --git a/software/bios/tftp.c b/software/bios/tftp.c index 6d796de1..29e26657 100644 --- a/software/bios/tftp.c +++ b/software/bios/tftp.c @@ -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;