From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valdis.Kletnieks@vt.edu (Valdis.Kletnieks at vt.edu) Date: Thu, 24 Sep 2015 11:00:02 -0400 Subject: getting warning when a method parameter in a kernel module is not used In-Reply-To: References: Message-ID: <3590.1443106802@turing-police.cc.vt.edu> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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.