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
