Re: [PATCH] make /dev/kmem a config option

From: Jan Engelhardt
Date: Sun Feb 10 2008 - 19:13:19 EST



On Feb 10 2008 15:55, Arjan van de Ven wrote:
>+#ifdef CONFIG_DEVKMEM
> /*
> * This function reads the *virtual* memory as seen by the kernel.
> */
>@@ -585,6 +588,11 @@ static ssize_t write_kmem(struct file * file, const char __user * buf,
> *ppos = p;
> return virtr + wrote;
> }
>+#else
>+#define read_kmem NULL
>+#define write_kmem NULL
>+#define mmap_kmem NULL
>+#endif

Is the #else case needed? All kmem_fops uses seem #ifdef'ed out anyway,
except kmem_fops itself. In other words,

+#ifdef CONFIG_DEVKMEM
static const struct file_operations kmem_fops = {
...
}
+#endif

and do away with the three defines. No? :)
--
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/