getting warning when a method parameter in a kernel module is not used

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Thu Sep 24 11:00:02 EDT 2015


On Thu, 24 Sep 2015 17:25:15 +0300, Kevin Wilson said:
> Hi,
>
> When a method parameter in a kernel module is not used, we do not get
> any warning (as opposed to a variable which is not used).
>
> Is there any compilation flag which enables getting warning in such a case ?

No, and it's unclear that it would be worthwhile.

Consider a kernel module that implements a device driver, and the ->ioctl()
only implements ioctl(fd,START|STOP|PAUSE|RESUME,/* ignored parameter */).

Or any other case where there's a generic struct of pointers to functions that
have fixed signatures, but for a given module, we don't need to access one.



More information about the Kernelnewbies mailing list