summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2013-01-16 18:09:19 -0600
committerJoe Hershberger <joe.hershberger@ni.com>2013-06-24 19:11:12 -0500
commit61fdd4f7c3bd6e309c76647217837f0af30e8cf8 (patch)
tree8a753d84c81aad872542d0ffa1a531f933fabc9f /net
parent3d49412d5626eebdfca78dcaec7d817b45d6f03e (diff)
net/tftp: sparse fixes
tftp.c:464:17: warning: cast to restricted __be16 tftp.c:552:29: warning: cast to restricted __be16 tftp.c:640:33: warning: cast to restricted __be16 tftp.c:642:25: warning: cast to restricted __be16 Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Cc: Joe Hershberger <joe.hershberger@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/tftp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/tftp.c b/net/tftp.c
index 09790eb7cf8..6d333d559c1 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -446,8 +446,8 @@ static void
TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
unsigned len)
{
- ushort proto;
- ushort *s;
+ __be16 proto;
+ __be16 *s;
int i;
if (dest != TftpOurPort) {
@@ -465,7 +465,7 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
return;
len -= 2;
/* warning: don't use increment (++) in ntohs() macros!! */
- s = (ushort *)pkt;
+ s = (__be16 *)pkt;
proto = *s++;
pkt = (uchar *)s;
switch (ntohs(proto)) {
@@ -556,7 +556,7 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
if (len < 2)
return;
len -= 2;
- TftpBlock = ntohs(*(ushort *)pkt);
+ TftpBlock = ntohs(*(__be16 *)pkt);
update_block_number();
@@ -644,9 +644,9 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
case TFTP_ERROR:
printf("\nTFTP error: '%s' (%d)\n",
- pkt + 2, ntohs(*(ushort *)pkt));
+ pkt + 2, ntohs(*(__be16 *)pkt));
- switch (ntohs(*(ushort *)pkt)) {
+ switch (ntohs(*(__be16 *)pkt)) {
case TFTP_ERR_FILE_NOT_FOUND:
case TFTP_ERR_ACCESS_DENIED:
puts("Not retrying...\n");