mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
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>
This commit is contained in:
committed by
Joe Hershberger
parent
3d49412d56
commit
61fdd4f7c3
12
net/tftp.c
12
net/tftp.c
@@ -446,8 +446,8 @@ static void
|
|||||||
TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
||||||
unsigned len)
|
unsigned len)
|
||||||
{
|
{
|
||||||
ushort proto;
|
__be16 proto;
|
||||||
ushort *s;
|
__be16 *s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (dest != TftpOurPort) {
|
if (dest != TftpOurPort) {
|
||||||
@@ -465,7 +465,7 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
|||||||
return;
|
return;
|
||||||
len -= 2;
|
len -= 2;
|
||||||
/* warning: don't use increment (++) in ntohs() macros!! */
|
/* warning: don't use increment (++) in ntohs() macros!! */
|
||||||
s = (ushort *)pkt;
|
s = (__be16 *)pkt;
|
||||||
proto = *s++;
|
proto = *s++;
|
||||||
pkt = (uchar *)s;
|
pkt = (uchar *)s;
|
||||||
switch (ntohs(proto)) {
|
switch (ntohs(proto)) {
|
||||||
@@ -556,7 +556,7 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
|||||||
if (len < 2)
|
if (len < 2)
|
||||||
return;
|
return;
|
||||||
len -= 2;
|
len -= 2;
|
||||||
TftpBlock = ntohs(*(ushort *)pkt);
|
TftpBlock = ntohs(*(__be16 *)pkt);
|
||||||
|
|
||||||
update_block_number();
|
update_block_number();
|
||||||
|
|
||||||
@@ -644,9 +644,9 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
|||||||
|
|
||||||
case TFTP_ERROR:
|
case TFTP_ERROR:
|
||||||
printf("\nTFTP error: '%s' (%d)\n",
|
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_FILE_NOT_FOUND:
|
||||||
case TFTP_ERR_ACCESS_DENIED:
|
case TFTP_ERR_ACCESS_DENIED:
|
||||||
puts("Not retrying...\n");
|
puts("Not retrying...\n");
|
||||||
|
Reference in New Issue
Block a user