mbox series

[00/12] add HOST_SUPPORTS_UNALIGNED_ACCESS, reduce slirp warnings

Message ID 20180108172904.8772-1-f4bug@amsat.org
Headers show
Series add HOST_SUPPORTS_UNALIGNED_ACCESS, reduce slirp warnings | expand

Message

Philippe Mathieu-Daudé Jan. 8, 2018, 5:28 p.m. UTC
Hi,

A recent mail from Michael remembered me this pre-2.10 series eh :)

I tagged the last patch 'RFC' because I find it ugly and hope there is a nicer
way to write it.

Regards,

Phil.

Philippe Mathieu-Daudé (12):
  slirp: remove QEMU_PACKED from structures with don't require it
  slirp: struct icmp/ethhdr ARE packed
  slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero()
  slirp: add in6_multicast() and use it instead of IN6_IS_ADDR_MULTICAST()
  slirp: poison IN6_*_ADDR_*() macros to avoid them
  slirp: remove unused header
  slirp: remove unnecessary
  slirp: removed unused code
  slirp: add in6_dhcp_multicast()
  configure: disable unaligned access warning on x86 arch
  configure: add HOST_SUPPORTS_UNALIGNED_ACCESS
  slirp: use HOST_SUPPORTS_UNALIGNED_ACCESS

 configure         | 18 ++++++++++++
 slirp/dhcpv6.h    |  3 ++
 slirp/ip.h        | 23 ++++------------
 slirp/ip6.h       | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 slirp/ip6_icmp.h  |  6 ++--
 slirp/ip_icmp.h   |  2 +-
 slirp/libslirp.h  |  1 -
 slirp/slirp.h     |  5 ++--
 slirp/ip6_icmp.c  | 16 +++++------
 slirp/ndp_table.c |  6 ++--
 slirp/udp6.c      |  2 +-
 11 files changed, 126 insertions(+), 38 deletions(-)

Comments

Peter Maydell Jan. 8, 2018, 5:32 p.m. UTC | #1
On 8 January 2018 at 17:29, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  configure | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

This doesn't seem like the right approach to me. We
want this sort of thing to be a warning/error on x86,
because that's the host that everybody actually uses
to develop with. If they only show up on non-x86
hosts then the result will be a lot more bounced
pull requests because of only-non-x86 warnings.

thanks
-- PMM
Michael S. Tsirkin Jan. 8, 2018, 5:53 p.m. UTC | #2
On Mon, Jan 08, 2018 at 05:32:54PM +0000, Peter Maydell wrote:
> On 8 January 2018 at 17:29, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> >  configure | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> 
> This doesn't seem like the right approach to me. We
> want this sort of thing to be a warning/error on x86,
> because that's the host that everybody actually uses
> to develop with. If they only show up on non-x86
> hosts then the result will be a lot more bounced
> pull requests because of only-non-x86 warnings.
> 
> thanks
> -- PMM

And we can't be sure the compiler won't be doing something tricky by
assuming alignment in the future.
Philippe Mathieu-Daudé Jan. 8, 2018, 6:24 p.m. UTC | #3
On 01/08/2018 02:32 PM, Peter Maydell wrote:
> On 8 January 2018 at 17:29, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  configure | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
> 
> This doesn't seem like the right approach to me. We
> want this sort of thing to be a warning/error on x86,
> because that's the host that everybody actually uses
> to develop with. If they only show up on non-x86
> hosts then the result will be a lot more bounced
> pull requests because of only-non-x86 warnings.

Ok, good point.

Thanks,

Phil.
no-reply@patchew.org Jan. 8, 2018, 7:41 p.m. UTC | #4
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180108172904.8772-1-f4bug@amsat.org
Subject: [Qemu-devel] [PATCH 00/12] add HOST_SUPPORTS_UNALIGNED_ACCESS, reduce slirp warnings

=== 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

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
Switched to a new branch 'test'
5d996c6ff9 slirp: use HOST_SUPPORTS_UNALIGNED_ACCESS
14a3d450b8 configure: add HOST_SUPPORTS_UNALIGNED_ACCESS
73c11da125 configure: disable unaligned access warning on x86 arch
4e5e318d16 slirp: add in6_dhcp_multicast()
4cd7293d19 slirp: removed unused code
2e3244129b slirp: remove unnecessary
1803914958 slirp: remove unused header
381b027933 slirp: poison IN6_*_ADDR_*() macros to avoid them
5f7bee9c84 slirp: add in6_multicast() and use it instead of IN6_IS_ADDR_MULTICAST()
733c0d2f92 slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero()
accd0acef0 slirp: struct icmp/ethhdr ARE packed
2360510b2b slirp: remove QEMU_PACKED from structures with don't require it

=== OUTPUT BEGIN ===
Checking PATCH 1/12: slirp: remove QEMU_PACKED from structures with don't require it...
Checking PATCH 2/12: slirp: struct icmp/ethhdr ARE packed...
Checking PATCH 3/12: slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero()...
Checking PATCH 4/12: slirp: add in6_multicast() and use it instead of IN6_IS_ADDR_MULTICAST()...
Checking PATCH 5/12: slirp: poison IN6_*_ADDR_*() macros to avoid them...
WARNING: architecture specific defines should be avoided
#20: FILE: slirp/ip6.h:11:
+#ifdef __GNUC__

total: 0 errors, 1 warnings, 25 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.
Checking PATCH 6/12: slirp: remove unused header...
Checking PATCH 7/12: slirp: remove unnecessary...
Checking PATCH 8/12: slirp: removed unused code...
Checking PATCH 9/12: slirp: add in6_dhcp_multicast()...
Checking PATCH 10/12: configure: disable unaligned access warning on x86 arch...
Checking PATCH 11/12: configure: add HOST_SUPPORTS_UNALIGNED_ACCESS...
Checking PATCH 12/12: slirp: use HOST_SUPPORTS_UNALIGNED_ACCESS...
ERROR: return is not a function, parentheses are not required
#59: FILE: slirp/ip6.h:98:
+    return (aa[prefix_len / 8] >> (8 - (prefix_len % 8)))

ERROR: return is not a function, parentheses are not required
#90: FILE: slirp/ip6.h:139:
+    return (aa[prefix_len / 8] & ((1U << (8 - (prefix_len % 8))) - 1))

total: 2 errors, 0 warnings, 92 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@freelists.org