lkml.org 
[lkml]   [2005]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 1/7] BSD Secure Levels: printk overhaul
From
Date
On Tue, 2005-05-17 at 10:23 -0500, Michael Halcrow wrote:
> struct seclvl_attribute {
> struct attribute attr;
> - ssize_t(*show) (struct seclvl_obj *, char *);
> - ssize_t(*store) (struct seclvl_obj *, const char *, size_t);
> + ssize_t(*show) (struct seclvl_obj *, char *);
> + ssize_t(*store) (struct seclvl_obj *, const char *, size_t);
> };

You've changed tabs to spaces.

> /**
> @@ -198,15 +196,15 @@
> static int seclvl_sanity(int reqlvl)
> {
> if ((reqlvl < -1) || (reqlvl > 2)) {
> - seclvl_printk(1, KERN_WARNING, "Attempt to set seclvl out of "
> - "range: [%d]\n", reqlvl);
> + seclvl_printk(1, KERN_WARNING "%s: Attempt to set seclvl out "
> + "of range: [%d]\n", __FUNCTION__, reqlvl);

Instead of changing each and every seclvl_printk() call to add
__FUNCTION__, why not do this:

+static void __seclvl_printk(int verb, const char *fmt, ...)
...

#define seclvl_printk(verb, fmt, arg...) \
__seclvl_printk(verb, __FUNCTION__ ": " fmt, arg)

It requires that the fmt be a string literal, but it saves a lot of code
duplication. I'm sure there are some more examples of this around as
well.

-- Dave

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

\
 
 \ /
  Last update: 2005-05-19 03:34    [W:0.125 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site