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

From: JÃrn Engel
Date: Tue Oct 21 2008 - 02:42:46 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/