qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH] slirp: Remove unused return value of tftp_send_next_block
Date: Fri, 14 Sep 2012 22:09:23 +0200	[thread overview]
Message-ID: <50538EF3.7060100@reactos.org> (raw)
In-Reply-To: <50536AC8.7040801@siemens.com>

Jan Kiszka a écrit :
> No caller actually makes use of this value, so let's simplify the code.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Acked-by: Hervé Poussineau <hpoussin@reactos.org>

> ---
> 
> Applies on top of http://thread.gmane.org/gmane.comp.emulators.qemu/169909
> 
>  slirp/tftp.c |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/slirp/tftp.c b/slirp/tftp.c
> index c6a5df2..cf7e3b8 100644
> --- a/slirp/tftp.c
> +++ b/slirp/tftp.c
> @@ -197,8 +197,8 @@ out:
>    tftp_session_terminate(spt);
>  }
>  
> -static int tftp_send_next_block(struct tftp_session *spt,
> -                                struct tftp_t *recv_tp)
> +static void tftp_send_next_block(struct tftp_session *spt,
> +                                 struct tftp_t *recv_tp)
>  {
>    struct sockaddr_in saddr, daddr;
>    struct mbuf *m;
> @@ -208,7 +208,7 @@ static int tftp_send_next_block(struct tftp_session *spt,
>    m = m_get(spt->slirp);
>  
>    if (!m) {
> -    return -1;
> +    return;
>    }
>  
>    memset(m->m_data, 0, m->m_size);
> @@ -235,7 +235,7 @@ static int tftp_send_next_block(struct tftp_session *spt,
>  
>      tftp_send_error(spt, 1, "File not found", tp);
>  
> -    return -1;
> +    return;
>    }
>  
>    m->m_len = sizeof(struct tftp_t) - (512 - nobytes) -
> @@ -251,7 +251,6 @@ static int tftp_send_next_block(struct tftp_session *spt,
>    }
>  
>    spt->block_nr++;
> -  return 0;
>  }
>  
>  static void tftp_handle_rrq(Slirp *slirp, struct tftp_t *tp, int pktlen)
> @@ -383,10 +382,7 @@ static void tftp_handle_ack(Slirp *slirp, struct tftp_t *tp, int pktlen)
>      return;
>    }
>  
> -  if (tftp_send_next_block(&slirp->tftp_sessions[s],
> -                           tp) < 0) {
> -    return;
> -  }
> +  tftp_send_next_block(&slirp->tftp_sessions[s], tp);
>  }
>  
>  static void tftp_handle_error(Slirp *slirp, struct tftp_t *tp, int pktlen)

      reply	other threads:[~2012-09-14 20:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 17:35 [Qemu-devel] [PATCH] slirp: Remove unused return value of tftp_send_next_block Jan Kiszka
2012-09-14 20:09 ` Hervé Poussineau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50538EF3.7060100@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=aurelien@aurel32.net \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).