From: Samuel Thibault <samuel.thibault@gnu.org>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>,
qemu-trivial@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH] slirp: Remove superfluous memset() calls from the TFTP code
Date: Mon, 27 Jun 2016 21:49:28 +0200 [thread overview]
Message-ID: <20160627194928.GI3403@var.home> (raw)
In-Reply-To: <1467024096-17942-1-git-send-email-thuth@redhat.com>
Thomas Huth, on Mon 27 Jun 2016 12:41:36 +0200, wrote:
> Commit fad7fb9ccd8013ea03 ("Add IPv6 support to the TFTP code")
> refactored some common code for preparing the mbuf into a new
> function called tftp_prep_mbuf_data(). One part of this common
> code is to do a "memset(m->m_data, 0, m->m_size);" for the related
> buffer first. However, at two spots, the memset() was not removed
> from the calling function, so it currently done twice in these code
> paths. Thus let's delete these superfluous memsets in the calling
> functions now.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Thanks!
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
> slirp/tftp.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/slirp/tftp.c b/slirp/tftp.c
> index 12b5ff6..3673402 100644
> --- a/slirp/tftp.c
> +++ b/slirp/tftp.c
> @@ -208,8 +208,6 @@ static void tftp_send_error(struct tftp_session *spt,
> goto out;
> }
>
> - memset(m->m_data, 0, m->m_size);
> -
> tp = tftp_prep_mbuf_data(spt, m);
>
> tp->tp_op = htons(TFTP_ERROR);
> @@ -237,8 +235,6 @@ static void tftp_send_next_block(struct tftp_session *spt,
> return;
> }
>
> - memset(m->m_data, 0, m->m_size);
> -
> tp = tftp_prep_mbuf_data(spt, m);
>
> tp->tp_op = htons(TFTP_DATA);
> --
> 1.8.3.1
>
--
Samuel
<macavity> bash: ls: Computer bought the farm
<macavity> THAT frightens ppl! :P
<macavity> id rather see: "bash: ls: Initialization of googol(AWAX)
disengaged in HYPER32/64 mode due to faulty page request at
AX:12A34F84B"
<macavity> at least that would give me the feeling that the
*programmers* knows what is going on :P
(lovely Hurd...)
prev parent reply other threads:[~2016-06-27 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-27 10:41 [Qemu-trivial] [PATCH] slirp: Remove superfluous memset() calls from the TFTP code Thomas Huth
2016-06-27 19:49 ` Samuel Thibault [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=20160627194928.GI3403@var.home \
--to=samuel.thibault@gnu.org \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=thuth@redhat.com \
/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).