lkml.org 
[lkml]   [2018]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 3/6] parisc: add system call table generation support
Firoz Khan wrote:

>> > +
>> > + my_abi="$(cut -d'|' -f2 <<< $my_abis)"
>
> Here is the logic of identifying the generated script is for compat
> interface
> or not. So systbl_abi_syscall_table_c32 := common,compat,32 in Makefile
> will parse the script and check the second string whether this is
> "compat" or not.
>
> Other ways are:
> 1. add an extra flag, that will again add the complexity
> 2. check if [ ${out: -5} = "c32.h" ], this looks weird
>
> Is there any better way to do the same?

What part is that comment directed at? I guess it's the next hunk, so
I'll comment on that.

>> "<<<" is a bash extension and will not work with /bin/sh.
>>
>> > + while read nr abi name entry compat ; do
>> > + if [ $my_abi = "compat" ]; then
>> > + if [ -z "$compat" ]; then
>> > + emit $nxt $nr $entry
>> > + else
>> > + emit $nxt $nr $compat
>> > + fi
>> > + else
>> > + emit $nxt $nr $entry
>> > + fi
>>
>> I would go for a local variable being set to $compat or $entry and
>> calling emit at only one place. And there should be only one if with 2
>> expressions, no need for 3 branches.

if [ $my_abi = "compat" -a -n "${compat}" ]; then
somevar=${compat}
else
somevar=${entry}
fi
emit $nxt $nr $somevar

Eike

\
 
 \ /
  Last update: 2018-10-12 16:04    [W:0.194 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site