2018-12-04 21:49:29

by Anders Roxell

[permalink] [raw]
Subject: [PATCH] scripts/atomic: change 'fold' to 'grep'

Some distibutions and build systems doesn't include 'fold' from
coreutils default.

.../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found

Rework to use 'grep' instead of 'fold' to use a dependency that is
already used a lot in the kernel.

Reported-by: Naresh Kamboju <[email protected]>
Suggested-by: Will Deacon <[email protected]>
Signed-off-by: Anders Roxell <[email protected]>
---
scripts/atomic/atomic-tbl.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/atomic/atomic-tbl.sh b/scripts/atomic/atomic-tbl.sh
index 9d6be538a987..81d5c32039dd 100755
--- a/scripts/atomic/atomic-tbl.sh
+++ b/scripts/atomic/atomic-tbl.sh
@@ -180,7 +180,7 @@ gen_proto_variants()
#gen_proto(meta, ...)
gen_proto() {
local meta="$1"; shift
- for m in $(echo "${meta}" | fold -w1); do
+ for m in $(echo "${meta}" | grep -o .); do
gen_proto_variants "${m}" "$@"
done
}
--
2.19.2



2018-12-06 15:53:25

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] scripts/atomic: change 'fold' to 'grep'

[+ Ingo and Mark]

On Tue, Dec 04, 2018 at 10:47:13PM +0100, Anders Roxell wrote:
> Some distibutions and build systems doesn't include 'fold' from
> coreutils default.
>
> .../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found
>
> Rework to use 'grep' instead of 'fold' to use a dependency that is
> already used a lot in the kernel.
>
> Reported-by: Naresh Kamboju <[email protected]>
> Suggested-by: Will Deacon <[email protected]>
> Signed-off-by: Anders Roxell <[email protected]>
> ---
> scripts/atomic/atomic-tbl.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/atomic/atomic-tbl.sh b/scripts/atomic/atomic-tbl.sh
> index 9d6be538a987..81d5c32039dd 100755
> --- a/scripts/atomic/atomic-tbl.sh
> +++ b/scripts/atomic/atomic-tbl.sh
> @@ -180,7 +180,7 @@ gen_proto_variants()
> #gen_proto(meta, ...)
> gen_proto() {
> local meta="$1"; shift
> - for m in $(echo "${meta}" | fold -w1); do
> + for m in $(echo "${meta}" | grep -o .); do
> gen_proto_variants "${m}" "$@"
> done

Acked-by: Will Deacon <[email protected]>

Ingo -- please can you take this one via -tip?

Cheers,

Will

2018-12-06 16:17:36

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] scripts/atomic: change 'fold' to 'grep'


* Will Deacon <[email protected]> wrote:

> [+ Ingo and Mark]
>
> On Tue, Dec 04, 2018 at 10:47:13PM +0100, Anders Roxell wrote:
> > Some distibutions and build systems doesn't include 'fold' from
> > coreutils default.
> >
> > .../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found
> >
> > Rework to use 'grep' instead of 'fold' to use a dependency that is
> > already used a lot in the kernel.
> >
> > Reported-by: Naresh Kamboju <[email protected]>
> > Suggested-by: Will Deacon <[email protected]>
> > Signed-off-by: Anders Roxell <[email protected]>
> > ---
> > scripts/atomic/atomic-tbl.sh | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/atomic/atomic-tbl.sh b/scripts/atomic/atomic-tbl.sh
> > index 9d6be538a987..81d5c32039dd 100755
> > --- a/scripts/atomic/atomic-tbl.sh
> > +++ b/scripts/atomic/atomic-tbl.sh
> > @@ -180,7 +180,7 @@ gen_proto_variants()
> > #gen_proto(meta, ...)
> > gen_proto() {
> > local meta="$1"; shift
> > - for m in $(echo "${meta}" | fold -w1); do
> > + for m in $(echo "${meta}" | grep -o .); do
> > gen_proto_variants "${m}" "$@"
> > done
>
> Acked-by: Will Deacon <[email protected]>
>
> Ingo -- please can you take this one via -tip?

I'm still waiting for a reply to my previous concerns expressed in:

Re: [tip:locking/core] locking/atomics: Check generated headers are up-to-date
<[email protected]>

Will remove it from linux-next if there's no good resolution for this
cycle.

Thanks,

Ingo

2018-12-10 19:47:48

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH] scripts/atomic: change 'fold' to 'grep'

Hi Ingo,

On Thu, Dec 06, 2018 at 05:15:28PM +0100, Ingo Molnar wrote:
>
> * Will Deacon <[email protected]> wrote:
>
> > [+ Ingo and Mark]
> >
> > On Tue, Dec 04, 2018 at 10:47:13PM +0100, Anders Roxell wrote:
> > > Some distibutions and build systems doesn't include 'fold' from
> > > coreutils default.
> > >
> > > .../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found
> > >
> > > Rework to use 'grep' instead of 'fold' to use a dependency that is
> > > already used a lot in the kernel.
> > >
> > > Reported-by: Naresh Kamboju <[email protected]>
> > > Suggested-by: Will Deacon <[email protected]>
> > > Signed-off-by: Anders Roxell <[email protected]>
> > > ---
> > > scripts/atomic/atomic-tbl.sh | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/scripts/atomic/atomic-tbl.sh b/scripts/atomic/atomic-tbl.sh
> > > index 9d6be538a987..81d5c32039dd 100755
> > > --- a/scripts/atomic/atomic-tbl.sh
> > > +++ b/scripts/atomic/atomic-tbl.sh
> > > @@ -180,7 +180,7 @@ gen_proto_variants()
> > > #gen_proto(meta, ...)
> > > gen_proto() {
> > > local meta="$1"; shift
> > > - for m in $(echo "${meta}" | fold -w1); do
> > > + for m in $(echo "${meta}" | grep -o .); do
> > > gen_proto_variants "${m}" "$@"
> > > done
> >
> > Acked-by: Will Deacon <[email protected]>
> >
> > Ingo -- please can you take this one via -tip?
>
> I'm still waiting for a reply to my previous concerns expressed in:
>
> Re: [tip:locking/core] locking/atomics: Check generated headers are up-to-date
> <[email protected]>
>
> Will remove it from linux-next if there's no good resolution for this
> cycle.

I've just sent a couple of patches for that; please see:

https://lkml.kernel.org/r/[email protected]

Thanks,
Mark.