make hdrscheck.sh force __asm__ in exported headers
PATCH 1/1 make hdrscheck.sh force __asm__ in exported headers
This updates scripts/hdrschecks.sh by grepping for asm() constructs and rejecting them in favor of __asm__() in exported headers.
---
scripts/hdrcheck.sh +11 -0
@@ -6,5 +6,16 @@ for FILE in `grep '^[ \t]*#[ \t]*include[ \t]*<' $2 | cut -f2 -d\< | cut -f1 -d\ exit 1 fi done + +# make sure we export __asm__(), not asm() +lines=$(grep -n -E \ + -e '\<asm[[:space:]]*(_{1,2}?volatile_{1,2}?[[:space:]]*)?\(' \ + $2) +if [ -n "$lines" ] ; then + echo "$2 should convert asm() usage to __asm__() in exported headers" + echo "$lines" + exit 1 +fi + # FIXME: List dependencies into $3 touch $3
Quoted 2 lines · On Sun, 17 Jun 2007 18:54:24 -0400 Mike Frysinger <[email protected]> wrote:
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.
And does the kernel pass these checks? Which architectures have been tested?
Quoted 5 lines · Andrew Morton
Quoted 2 lines · On Sun, 17 Jun 2007 18:54:24 -0400 Mike Frysinger <[email protected]> wrote:
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.And does the kernel pass these checks?
nope ... should i audit the arches before this gets merged ?
Quoted 1 line
Which architectures have been tested?
i386 passes, blackfin/x86_64 fail a simple asm/unistd.h, and x86_64 fails a bunch in asm/msr.h, but last time i tried to patch that, the maintainer said they were going to be hiding a bunch of that stuff anyways
-mike
Quoted 8 lines · On Mon, 18 Jun 2007 01:17:46 -0400 Mike Frysinger <[email protected]> wrote:
Quoted 5 lines · Andrew Morton
Quoted 2 lines · On Sun, 17 Jun 2007 18:54:24 -0400 Mike Frysinger <[email protected]> wrote:
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.And does the kernel pass these checks?
nope ... should i audit the arches before this gets merged ?
Yes please. I'd rather not break things in this fashion: it causes a storm of emails which I need to redirect to the appropriate maintainers who then take an arbitrarily long time to do anything. Meanwhile lots of testers get impacted and this reduces the testing level of all the other thousands of patches in there.
Quoted 5 lines
Quoted 1 line
Which architectures have been tested?
i386 passes, blackfin/x86_64 fail a simple
asm/unistd.h, andx86_64fails a bunch inasm/msr.h, but last time i tried to patch that, the maintainer said they were going to be hiding a bunch of that stuff anyways
Well I would prefer that we merge as many fixes as poss into -mm before merging this patch - to reduce the impact on testers.
If these fixes are "wrong" but work then that's fine. I just keep spamming the maintainer with the wrong-but-works patch until he wakes up and fixes it for real.
Also, your changelog sucks:
This updates scripts/hdrschecks.sh by grepping for asm() constructs and rejecting them in favor of __asm__() in exported headers.
well OK. But for what reason? We can see a lot of pain in this patch but no gain. The changelog should tell us what the benefit is, so we can make informed tradeoff decisions.
Quoted 8 lines · Andrew Morton
Quoted 7 lines · On Mon, 18 Jun 2007 01:17:46 -0400 Mike Frysinger <[email protected]> wrote:
Quoted 5 lines · Andrew Morton
Quoted 2 lines · On 17 Jun 2007 18:54:24 -0400 Mike Frysinger <[email protected]> wrote:
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.And does the kernel pass these checks?
Quoted 7 lines
Quoted 1 line
nope ... should i audit the arches before this gets merged ?
Yes please. I'd rather not break things in this fashion: it causes a storm of emails which I need to redirect to the appropriate maintainers who then take an arbitrarily long time to do anything. Meanwhile lots of testers get impacted and this reduces the testing level of all the other thousands of patches in there.
makes sense, i'll post some stuff
Quoted 8 lines
Also, your changelog sucks:
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.well OK. But for what reason? We can see a lot of pain in this patch but no gain. The changelog should tell us what the benefit is, so we can make informed tradeoff decisions.
sorry, i blame GNU changelog style ;)
-mike
Quoted 8 lines · Andrew Morton
Also, your changelog sucks:
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.well OK. But for what reason? We can see a lot of pain in this patch but no gain. The changelog should tell us what the benefit is, so we can make informed tradeoff decisions.
err, should have included the rationale in previous e-mail ...
we want to audit asm/volatile because both constructs will fail in userland builds when GNU extensions are turned off (like -std=c99) ... __asm__ and __volatile__ will work in both places.
-mike
Quoted 11 lines · Andrew Morton
Quoted 4 lines · On Mon, 18 Jun 2007 01:17:46 -0400 Mike Frysinger <[email protected]> wrote:
Quoted 1 line · Andrew Morton
And does the kernel pass these checks?
nope ... should i audit the arches before this gets merged ?
Yes please. I'd rather not break things in this fashion: it causes a storm of emails which I need to redirect to the appropriate maintainers who then take an arbitrarily long time to do anything. Meanwhile lots of testers get impacted and this reduces the testing level of all the other thousands of patches in there.
with the few patches i just sent out, the following pass:
alpha arm avr32 blackfin i386 ia64 m68k mips powerpc s390 sh sparc x86_64
cris and parisc fail vanilla git regardless
-mike
Quoted 2 lines · Mike Frysinger
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.
Hi Mike.
I have a new version of hdrcheck in works written in perl
and a bit faster too.
I hope to finish it off this weekend and sent it for review. Could I ask you to pick it up and add the below test to that version when it hits mainline - assuming that the other patches has hit mainline too. I do not want this check before we are clean so we basically use it to check that noone introduce a bug.
And next time please put some effort in the _why_ part more than the _how_ part of the changelog.
Sam
Quoted 11 lines · Sam Ravnborg
Quoted 2 lines · Mike Frysinger
This updates
scripts/hdrschecks.shby grepping forasm()constructs and rejecting them in favor of__asm__()in exported headers.I have a new version of hdrcheck in works written in perl
and a bit faster too.
I hope to finish it off this weekend and sent it for review. Could I ask you to pick it up and add the below test to that version when it hits mainline - assuming that the other patches has hit mainline too. I do not want this check before we are clean so we basically use it to check that noone introduce a bug.
that's fine ... one of the other things i wanted to add were checks to make sure the exported headers did not contain [us](8|16|32|64) references, but there's headers which refer to these in comment blocks or use them as members of structs (like the netfilter code) so i couldnt add that check without passing things through the preprocessor ... perhaps your perl code would better accommodate this, perhaps not ;)
-mike