2019-10-11 16:19:46

by Ben Dooks

[permalink] [raw]
Subject: sparse warnings on undeclared asmlinkage

I was reviewing the sparse output for the current kernel release and
note there are a number of warnings about un-declared functions which
are only used for code in assembly.

I was wondering if we should just ignore those, and have either a
new attribute for "undeclared is ok" or to make spare just ignore
anything with the syscall_linkage attribute?

--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html


2019-10-11 18:54:55

by Luc Van Oostenryck

[permalink] [raw]
Subject: Re: sparse warnings on undeclared asmlinkage

On Fri, Oct 11, 2019 at 05:18:58PM +0100, Ben Dooks wrote:
> I was reviewing the sparse output for the current kernel release and
> note there are a number of warnings about un-declared functions which
> are only used for code in assembly.
>
> I was wondering if we should just ignore those, and have either a
> new attribute for "undeclared is ok" or to make spare just ignore
> anything with the syscall_linkage attribute?

There is already an attribute and it's corresponding kernel define:
__attribute__((__externally_visible__)), aka __visible.

My point of view on the subject is more about the lines:
* who knows about __visble/externally_visible?
* what's wrong/are the disadvantge to adding the prototype?
But it seems that some maintainers are against using prototypes
for functions only used in assembly.

Cheers,
-- Luc