aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_debugfs.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-05-14 17:14:54 -0400
committerSven Eckelmann <sven@narfation.org>2011-05-30 01:39:33 -0400
commit704509b8d44886cebfbaff1a9813c35dfa986954 (patch)
tree7b353f1d4a33b31d55d2a85f8d70882ade1868ce /net/batman-adv/bat_debugfs.c
parent958ca5985604a6f13387d32de489365df816558b (diff)
batman-adv: Calculate sizeof using variable insead of types
Documentation/CodingStyle recommends to use the form p = kmalloc(sizeof(*p), ...); to calculate the size of a struct and not the version where the struct name is spelled out to prevent bugs when the type of p changes. This also seems appropriate for manipulation of buffers when they are directly associated with p. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/bat_debugfs.c')
-rw-r--r--net/batman-adv/bat_debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c
index 1049ae3f5367..d0af9bf69e46 100644
--- a/net/batman-adv/bat_debugfs.c
+++ b/net/batman-adv/bat_debugfs.c
@@ -185,7 +185,7 @@ static int debug_log_setup(struct bat_priv *bat_priv)
185 if (!bat_priv->debug_dir) 185 if (!bat_priv->debug_dir)
186 goto err; 186 goto err;
187 187
188 bat_priv->debug_log = kzalloc(sizeof(struct debug_log), GFP_ATOMIC); 188 bat_priv->debug_log = kzalloc(sizeof(*bat_priv->debug_log), GFP_ATOMIC);
189 if (!bat_priv->debug_log) 189 if (!bat_priv->debug_log)
190 goto err; 190 goto err;
191 191