Re: [announce] new tree: "fix all build warnings, on all configs"

Jörn Engel
2008-10-21T06:42:46Z

On Mon, 20 October 2008 21:21:10 +0200, Ingo Molnar wrote:
>
> /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
> #define fops_get(fops) \
> - (((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
> + (((fops != NULL) && try_module_get((fops)->owner) ? (fops) : NULL))
> #define fops_put(fops) \
> - do { if (fops) module_put((fops)->owner); } while(0)
> + do { if (fops != NULL) module_put((fops)->owner); } while(0)

This, I would argue, makes the code worse.

> diff --git a/include/linux/audit.h b/include/linux/audit.h
> index 6272a39..a3f78d0 100644
> --- a/include/linux/audit.h
> +++ b/include/linux/audit.h
> @@ -580,7 +580,8 @@ extern int audit_enabled;
> #define audit_log(c,g,t,f,...) do { ; } while (0)
> #define audit_log_start(c,g,t) ({ NULL; })
> #define audit_log_vformat(b,f,a) do { ; } while (0)
> -#define audit_log_format(b,f,...) do { ; } while (0)
> +static inline void __attribute__ ((format(printf, 2, 3)))
> +audit_log_format(struct audit_buffer *ab, const char *fmt, ...) { }

Took me a moment to notice the two lines aren't independent. A tab
would have been appreciated.

> diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
> index 427b820..ac55b62 100644
> --- a/drivers/net/wireless/b43/b43.h
> +++ b/drivers/net/wireless/b43/b43.h
> @@ -853,7 +853,8 @@ void b43warn(struct b43_wl *wl, const char *fmt, ...)
> void b43dbg(struct b43_wl *wl, const char *fmt, ...)
> __attribute__ ((format(printf, 2, 3)));
> #else /* DEBUG */
> -# define b43dbg(wl, fmt...) do { /* nothing */ } while (0)
> +static inline void __attribute__ ((format(printf, 2, 3)))
> +b43dbg(struct b43_wl *wl, const char *fmt, ...) { }

Dito.

Jörn

--
A victorious army first wins and then seeks battle.
-- Sun Tzu