浏览代码

genirq/proc: Avoid uninitalized variable warning

kernel/irq/proc.c: In function ‘show_irq_affinity’:
include/linux/cpumask.h:24:29: warning: ‘mask’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define cpumask_bits(maskp) ((maskp)->bits)

gcc is silly, but admittedly it can't know that this won't be called with
anything else than the enumerated constants.

Shut up the warning by creating a default clause.

Fixes: 6bc6d4abd22e ("genirq/proc: Use the the accessor to report the effective affinity
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Thomas Gleixner 8 年之前
父节点
当前提交
b33394ba5c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      kernel/irq/proc.c

+ 2 - 2
kernel/irq/proc.c

@@ -63,9 +63,9 @@ static int show_irq_affinity(int type, struct seq_file *m)
 #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
 #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
 		mask = irq_data_get_effective_affinity_mask(&desc->irq_data);
 		mask = irq_data_get_effective_affinity_mask(&desc->irq_data);
 		break;
 		break;
-#else
-		return -EINVAL;
 #endif
 #endif
+	default:
+		return -EINVAL;
 	}
 	}
 
 
 	switch (type) {
 	switch (type) {