From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
andrew.cooper3@citrix.com, xen-devel@lists.xen.org,
julien.grall@arm.com, jbeulich@suse.com,
zhaoshenglong@huawei.com, roger.pau@citrix.com
Subject: Re: [PATCH v6] acpi: Prevent GPL-only code from seeping into non-GPL binaries
Date: Mon, 26 Sep 2016 11:03:42 -0400 [thread overview]
Message-ID: <a4aabe75-36c9-91a8-abb1-8d4e9c0050c2@oracle.com> (raw)
In-Reply-To: <22505.13461.748687.43726@mariner.uk.xensource.com>
On 09/26/2016 10:45 AM, Ian Jackson wrote:
> Boris Ostrovsky writes ("Re: [PATCH v6] acpi: Prevent GPL-only code from seeping into non-GPL binaries"):
>> There are two interdependent variables that I need to print. The C
>> equivalent is
>>
>> for ( i = 0; i < 4; i++ )
>> printf("%d %c\n", i, 'A'+i);
>>
>> The character value is derived from 'i', which in this example is an
>> index into 'links' array.
>>
>> I suggested in response to Jan
>>
>> link=`echo "A B C D" | cut -d" " -f $i`
> If the indices are necessarily successive integers:
>
> links="A B C D"
> index=0
> for link in $links; do
> index=$(( $index + 1 ))
> something with $link and $index
>
> If the indices are arbitrary:
>
> links="1:A 4:B 7:C 10:D"
> for linkinfo in $links; do
> link=${linkinfo#*:}
> index=${linkinfo%%:*}
> something with $link and $index
The indices are not successive, in one case they are a function of two
enclosing loop indices, such as
for dev in $(seq 1 31)
do
for intx in $(seq 0 3)
do
link_idx=$(((dev + intx) & 3))
printf " Package(){0x%04xffff, %u, \\\\_SB.PCI0.LNK%c,
0},\n" \
$dev $intx ${links:$link_idx:1}
done
done
(And then there might also be a question of portability with the second
approach?)
So if you don't object to
link=`echo "A B C D" | cut -d" " -f $i`
I'd rather go with that.
(I'll add '#!/bin/sh' as you requested in another email)
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-09-26 15:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 19:14 [PATCH v6] acpi: Prevent GPL-only code from seeping into non-GPL binaries Boris Ostrovsky
2016-09-26 6:46 ` Jan Beulich
2016-09-26 12:49 ` Boris Ostrovsky
2016-09-26 13:08 ` Jan Beulich
2016-09-26 13:43 ` Boris Ostrovsky
2016-09-26 13:51 ` Jan Beulich
2016-09-26 10:04 ` Wei Liu
2016-09-26 10:20 ` Ian Jackson
2016-09-26 10:24 ` Wei Liu
2016-09-26 12:58 ` Boris Ostrovsky
2016-09-26 13:02 ` Wei Liu
2016-09-26 14:45 ` Ian Jackson
2016-09-26 15:03 ` Boris Ostrovsky [this message]
2016-09-26 16:48 ` Ian Jackson
2016-09-26 18:20 ` Boris Ostrovsky
2016-09-27 9:24 ` Ian Jackson
2016-09-26 14:01 ` Boris Ostrovsky
2016-09-26 14:02 ` Wei Liu
2016-09-26 14:46 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a4aabe75-36c9-91a8-abb1-8d4e9c0050c2@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@arm.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=zhaoshenglong@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).