* [Qemu-devel] [PATCHv2] slirp: Fix spurious error report when sending directly
@ 2018-05-31 20:31 Samuel Thibault
2018-05-31 20:35 ` no-reply
2018-05-31 23:02 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Samuel Thibault @ 2018-05-31 20:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Samuel Thibault, stefanha, jan.kiszka, f4bug
Move check to where it actually is useful, and reduce scope of 'len'
variable along the way.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
Difference from v1:
- move check instead of initializing len.
slirp/socket.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/slirp/socket.c b/slirp/socket.c
index e2a71c9b04..08fe98907d 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -340,7 +340,7 @@ sosendoob(struct socket *so)
struct sbuf *sb = &so->so_rcv;
char buff[2048]; /* XXX Shouldn't be sending more oob data than this */
- int n, len;
+ int n;
DEBUG_CALL("sosendoob");
DEBUG_ARG("so = %p", so);
@@ -359,7 +359,7 @@ sosendoob(struct socket *so)
* send it all
*/
uint32_t urgc = so->so_urgc;
- len = (sb->sb_data + sb->sb_datalen) - sb->sb_rptr;
+ int len = (sb->sb_data + sb->sb_datalen) - sb->sb_rptr;
if (len > urgc) {
len = urgc;
}
@@ -374,13 +374,13 @@ sosendoob(struct socket *so)
len += n;
}
n = slirp_send(so, buff, len, (MSG_OOB)); /* |MSG_DONTWAIT)); */
- }
-
#ifdef DEBUG
- if (n != len) {
- DEBUG_ERROR((dfd, "Didn't send all data urgently XXXXX\n"));
- }
+ if (n != len) {
+ DEBUG_ERROR((dfd, "Didn't send all data urgently XXXXX\n"));
+ }
#endif
+ }
+
if (n < 0) {
return n;
}
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2] slirp: Fix spurious error report when sending directly
2018-05-31 20:31 [Qemu-devel] [PATCHv2] slirp: Fix spurious error report when sending directly Samuel Thibault
@ 2018-05-31 20:35 ` no-reply
2018-05-31 23:02 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: no-reply @ 2018-05-31 20:35 UTC (permalink / raw)
To: samuel.thibault; +Cc: famz, qemu-devel, f4bug, stefanha, jan.kiszka
Hi,
This series seems to have some coding style problems. See output below for
more information:
Type: series
Message-id: 20180531203110.17203-1-samuel.thibault@ens-lyon.org
Subject: [Qemu-devel] [PATCHv2] slirp: Fix spurious error report when sending directly
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))
done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/20180531203110.17203-1-samuel.thibault@ens-lyon.org -> patchew/20180531203110.17203-1-samuel.thibault@ens-lyon.org
Switched to a new branch 'test'
6f4cceab40 slirp: Fix spurious error report when sending directly
=== OUTPUT BEGIN ===
Checking PATCH 1/1: slirp: Fix spurious error report when sending directly...
ERROR: code indent should never use tabs
#21: FILE: slirp/socket.c:343:
+^Iint n;$
ERROR: code indent should never use tabs
#30: FILE: slirp/socket.c:362:
+^I^Iint len = (sb->sb_data + sb->sb_datalen) - sb->sb_rptr;$
ERROR: code indent should never use tabs
#39: FILE: slirp/socket.c:378:
+^I^Iif (n != len) {$
WARNING: line over 80 characters
#40: FILE: slirp/socket.c:379:
+ DEBUG_ERROR((dfd, "Didn't send all data urgently XXXXX\n"));
ERROR: code indent should never use tabs
#40: FILE: slirp/socket.c:379:
+^I^I^IDEBUG_ERROR((dfd, "Didn't send all data urgently XXXXX\n"));$
ERROR: code indent should never use tabs
#41: FILE: slirp/socket.c:380:
+^I^I}$
total: 5 errors, 1 warnings, 34 lines checked
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2] slirp: Fix spurious error report when sending directly
2018-05-31 20:31 [Qemu-devel] [PATCHv2] slirp: Fix spurious error report when sending directly Samuel Thibault
2018-05-31 20:35 ` no-reply
@ 2018-05-31 23:02 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-05-31 23:02 UTC (permalink / raw)
To: Samuel Thibault, qemu-devel; +Cc: stefanha, jan.kiszka
On 05/31/2018 05:31 PM, Samuel Thibault wrote:
> Move check to where it actually is useful, and reduce scope of 'len'
> variable along the way.
>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Thanks!
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>
> Difference from v1:
> - move check instead of initializing len.
>
> slirp/socket.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/slirp/socket.c b/slirp/socket.c
> index e2a71c9b04..08fe98907d 100644
> --- a/slirp/socket.c
> +++ b/slirp/socket.c
> @@ -340,7 +340,7 @@ sosendoob(struct socket *so)
> struct sbuf *sb = &so->so_rcv;
> char buff[2048]; /* XXX Shouldn't be sending more oob data than this */
>
> - int n, len;
> + int n;
>
> DEBUG_CALL("sosendoob");
> DEBUG_ARG("so = %p", so);
> @@ -359,7 +359,7 @@ sosendoob(struct socket *so)
> * send it all
> */
> uint32_t urgc = so->so_urgc;
> - len = (sb->sb_data + sb->sb_datalen) - sb->sb_rptr;
> + int len = (sb->sb_data + sb->sb_datalen) - sb->sb_rptr;
> if (len > urgc) {
> len = urgc;
> }
> @@ -374,13 +374,13 @@ sosendoob(struct socket *so)
> len += n;
> }
> n = slirp_send(so, buff, len, (MSG_OOB)); /* |MSG_DONTWAIT)); */
> - }
> -
> #ifdef DEBUG
> - if (n != len) {
> - DEBUG_ERROR((dfd, "Didn't send all data urgently XXXXX\n"));
> - }
> + if (n != len) {
> + DEBUG_ERROR((dfd, "Didn't send all data urgently XXXXX\n"));
> + }
> #endif
> + }
> +
> if (n < 0) {
> return n;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-31 23:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 20:31 [Qemu-devel] [PATCHv2] slirp: Fix spurious error report when sending directly Samuel Thibault
2018-05-31 20:35 ` no-reply
2018-05-31 23:02 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.