Re: [patch 1/1] Audit return code of create_proc_*

From: Ingo Oeser
Date: Sat Jul 16 2005 - 06:59:13 EST


Hi Domen,

On Friday 15 July 2005 00:19, you wrote:
> Audit return of create_proc_* functions.

This (and related changes) spam the log, if
kernel is compiled without /proc-support.

Kernels without /proc-support are quite common in the embedded world.

Just provide a function in a suitable header
(include/linux/proc_fs.h looks promising)
file, which contains the following:

#ifdef CONFIG_PROC_FS
#define procfs_failure(msg) do { printk(msg); } while(0)
#else
#define procfs_failure(msg) do {} while(0)
#endif

and use it instead of the direct printk call.

That way you get both: Your GCC or checking tool warning is silenced
and the log is not spammed for the embedded people.

For code, which is broken without procfs, the code
should be fixed or it should select PROC_FS in its Kconfig file.


Regards

Ingo Oeser


Attachment: pgp00000.pgp
Description: PGP signature