[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] xen/arm: domain: Fix MISRA C 2012 Rule 8.7 violation
- To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 6 Jul 2022 10:51:03 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YBNIL9BNcEakpDmLE8uqtNtzwj2UVAA+huGQiA/BClU=; b=TJynHGrSYLb/ILdmtXMKGIwy/k/99taHQTBaMZ/DYFP4rvJqTLkX9ZTlCc7m1spQaKf/vKT86PYdYbRg0/jjNx2lrSV59HpLbYs0wYmv7+Vu+0vVnN0beayWTAuDzV4ysvIY5ixImyDYduuOqckiJXTY20w0OIELe4EvoEmaRTSoAlngtpXJwbjFHS713zEouT7LlErmZ1A3x/8JzZYKTjU/e9DG+w48dPFM4w8Hdn+XTeBf/l1GbmxK0FKPKrIGxr+1DiXzO/knkq7JgcWwgLvB7Ciau5JxzktABK2LKFa0basyFIMqL44bhXPCassg/iK7LTs8oGTsW8ROxCaGhQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nKN2V9Fj1i0v+FdyUBYJjssb5+QtUNhSnQR2pg2iXoLhVPJKl1DO69hctwBQkvVsDcGuG82wbcsIGV4Y3464ogQ1s4+4W06Cf840kAMvj/DB0DBDjkDiqgCgtYGn7a4NvBbZbJh9CepBFH399ktpP6pI8oZ0jTDVg4R2SO0+qnqkqJrGTg18TLoOvhmfCN1A99Y9Cz77lF+RSJQmf7vJy6qGvSfeDnnwzBKX4jxGlQnoek5yop5Oci0Ppe077Y4Z386gQKrp9g7Qc1Komwe8KpQws9zo+oYgn23LaKE/m/KC/+6G4CH0ay8bAMTQHUgSjTK54YeTJrRj4Ihg8Pjs2g==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 06 Jul 2022 08:51:11 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 06.07.2022 10:43, Xenia Ragiadakou wrote:
> On 7/6/22 10:10, Jan Beulich wrote:
>> On 05.07.2022 23:02, Xenia Ragiadakou wrote:
>>> The function idle_loop() is referenced only in domain.c.
>>> Change its linkage from external to internal by adding the storage-class
>>> specifier static to its definitions.
>>>
>>> Since idle_loop() is referenced only in inline assembly, add the 'used'
>>> attribute to suppress unused-function compiler warning.
>>
>> While I see that Julien has already acked the patch, I'd like to point
>> out that using __used here is somewhat bogus. Imo the better approach
>> is to properly make visible to the compiler that the symbol is used by
>> the asm(), by adding a fake(?) input.
>
> I 'm afraid I do not understand what do you mean by "adding a fake(?)
> input". Can you please elaborate a little on your suggestion?
Once the asm() in question takes the function as an input, the compiler
will know that the function has a user (unless, of course, it finds a
way to elide the asm() itself). The "fake(?)" was because I'm not deeply
enough into Arm inline assembly to know whether the input could then
also be used as an instruction operand (which imo would be preferable) -
if it can't (e.g. because there's no suitable constraint or operand
modifier), it still can be an input just to inform the compiler.
Jan
|