]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
softirq: use const char * const for softirq_to_name, whitespace neatening
authorJoe Perches <joe@perches.com>
Fri, 3 Jan 2014 03:16:51 +0000 (14:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 6 Jan 2014 09:08:15 +0000 (20:08 +1100)
Reduce data size a little.
Reduce checkpatch noise.

$ size kernel/softirq.o*
   text    data     bss     dec     hex filename
  11554    6013    4008   21575    5447 kernel/softirq.o.new
  11474    6093    4008   21575    5447 kernel/softirq.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/interrupt.h
kernel/softirq.c

index db43b58a3355c7b97d3acb0902fede4a0883790b..0053adde0ed9a37111ffd273c17f6d19956a6a77 100644 (file)
@@ -360,7 +360,7 @@ enum
 /* map softirq index to softirq name. update 'softirq_to_name' in
  * kernel/softirq.c when adding a new softirq.
  */
-extern char *softirq_to_name[NR_SOFTIRQS];
+extern const char * const softirq_to_name[NR_SOFTIRQS];
 
 /* softirq mask and active fields moved to irq_cpustat_t in
  * asm/hardirq.h to get better cache usage.  KAO
index 553f2ff89301cc55141efbf1f7d34c832d761086..527520152ad23b977b464defc1a617ad0f6b9015 100644 (file)
@@ -56,7 +56,7 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
 
 DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
 
-char *softirq_to_name[NR_SOFTIRQS] = {
+const char * const softirq_to_name[NR_SOFTIRQS] = {
        "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL",
        "TASKLET", "SCHED", "HRTIMER", "RCU"
 };
@@ -128,7 +128,6 @@ void local_bh_disable(void)
 {
        __local_bh_disable(_RET_IP_, SOFTIRQ_DISABLE_OFFSET);
 }
-
 EXPORT_SYMBOL(local_bh_disable);
 
 static void __local_bh_enable(unsigned int cnt)
@@ -150,7 +149,6 @@ void _local_bh_enable(void)
        WARN_ON_ONCE(in_irq());
        __local_bh_enable(SOFTIRQ_DISABLE_OFFSET);
 }
-
 EXPORT_SYMBOL(_local_bh_enable);
 
 static inline void _local_bh_enable_ip(unsigned long ip)
@@ -167,7 +165,7 @@ static inline void _local_bh_enable_ip(unsigned long ip)
        /*
         * Keep preemption disabled until we are done with
         * softirq processing:
-        */
+        */
        preempt_count_sub(SOFTIRQ_DISABLE_OFFSET - 1);
 
        if (unlikely(!in_interrupt() && local_softirq_pending())) {
@@ -459,8 +457,7 @@ void open_softirq(int nr, void (*action)(struct softirq_action *))
 /*
  * Tasklets
  */
-struct tasklet_head
-{
+struct tasklet_head {
        struct tasklet_struct *head;
        struct tasklet_struct **tail;
 };
@@ -479,7 +476,6 @@ void __tasklet_schedule(struct tasklet_struct *t)
        raise_softirq_irqoff(TASKLET_SOFTIRQ);
        local_irq_restore(flags);
 }
-
 EXPORT_SYMBOL(__tasklet_schedule);
 
 void __tasklet_hi_schedule(struct tasklet_struct *t)
@@ -493,7 +489,6 @@ void __tasklet_hi_schedule(struct tasklet_struct *t)
        raise_softirq_irqoff(HI_SOFTIRQ);
        local_irq_restore(flags);
 }
-
 EXPORT_SYMBOL(__tasklet_hi_schedule);
 
 void __tasklet_hi_schedule_first(struct tasklet_struct *t)
@@ -504,7 +499,6 @@ void __tasklet_hi_schedule_first(struct tasklet_struct *t)
        __this_cpu_write(tasklet_hi_vec.head, t);
        __raise_softirq_irqoff(HI_SOFTIRQ);
 }
-
 EXPORT_SYMBOL(__tasklet_hi_schedule_first);
 
 static void tasklet_action(struct softirq_action *a)
@@ -524,7 +518,8 @@ static void tasklet_action(struct softirq_action *a)
 
                if (tasklet_trylock(t)) {
                        if (!atomic_read(&t->count)) {
-                               if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
+                               if (!test_and_clear_bit(TASKLET_STATE_SCHED,
+                                                       &t->state))
                                        BUG();
                                t->func(t->data);
                                tasklet_unlock(t);
@@ -559,7 +554,8 @@ static void tasklet_hi_action(struct softirq_action *a)
 
                if (tasklet_trylock(t)) {
                        if (!atomic_read(&t->count)) {
-                               if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
+                               if (!test_and_clear_bit(TASKLET_STATE_SCHED,
+                                                       &t->state))
                                        BUG();
                                t->func(t->data);
                                tasklet_unlock(t);
@@ -577,7 +573,6 @@ static void tasklet_hi_action(struct softirq_action *a)
        }
 }
 
-
 void tasklet_init(struct tasklet_struct *t,
                  void (*func)(unsigned long), unsigned long data)
 {
@@ -587,7 +582,6 @@ void tasklet_init(struct tasklet_struct *t,
        t->func = func;
        t->data = data;
 }
-
 EXPORT_SYMBOL(tasklet_init);
 
 void tasklet_kill(struct tasklet_struct *t)
@@ -603,7 +597,6 @@ void tasklet_kill(struct tasklet_struct *t)
        tasklet_unlock_wait(t);
        clear_bit(TASKLET_STATE_SCHED, &t->state);
 }
-
 EXPORT_SYMBOL(tasklet_kill);
 
 /*
@@ -753,9 +746,8 @@ static void takeover_tasklets(unsigned int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-static int cpu_callback(struct notifier_block *nfb,
-                                 unsigned long action,
-                                 void *hcpu)
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                       void *hcpu)
 {
        switch (action) {
 #ifdef CONFIG_HOTPLUG_CPU