projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36613c7
)
tftp.c (rx_callback): simplify expressions containing unnecessary casts
author
Werner Almesberger
<werner@almesberger.net>
Tue, 16 Apr 2013 16:55:22 +0000
(13:55 -0300)
committer
Sebastien Bourdeauducq
<sebastien@milkymist.org>
Tue, 16 Apr 2013 17:23:12 +0000
(19:23 +0200)
software/bios/tftp.c
patch
|
blob
|
history
diff --git
a/software/bios/tftp.c
b/software/bios/tftp.c
index 6d796de1a638a68494a569dd61fc274a3c0ef2cd..29e266579695a490cc239412e79260ca9bf5f8b8 100644
(file)
--- 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;