Skip to contentSkip to conversation

random: remove unused argument from add_interrupt_randomness()

PATCH In review Sultan Alsawaf 2 participants 5 messages Apr 30, 2018 – Feb 15, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 random: remove unused argument from add_interrupt_randomness()

Quoted 1 line

From cdc2a03f93fdec88ad040a212605e20ab97c3e19 Mon Sep 17 00:00:00 2001

From: Sultan Alsawaf <[email protected]>
Date: Sun, 29 Apr 2018 20:04:35 -0700
Subject: [PATCH] random: remove unused argument from add_interrupt_randomness()

The irq_flags parameter is not used. Remove it.

---
 drivers/char/random.c  | 4 ++--
 drivers/hv/vmbus_drv.c | 2 +-
 include/linux/random.h | 2 +-
 kernel/irq/handle.c    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/char/random.c +2 -2
index 38729baed6ee..d9e38523b383 100644
@@ -131,7 +131,7 @@
  *	void add_device_randomness(const void *buf, unsigned int size);
  * 	void add_input_randomness(unsigned int type, unsigned int code,
  *                                unsigned int value);
- *	void add_interrupt_randomness(int irq, int irq_flags);
+ *	void add_interrupt_randomness(int irq);
  * 	void add_disk_randomness(struct gendisk *disk);
  *
  * add_device_randomness() is for adding data to the random pool that
@@ -1164,7 +1164,7 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
 	return *ptr;
 }
 
-void add_interrupt_randomness(int irq, int irq_flags)
+void add_interrupt_randomness(int irq)
 {
 	struct entropy_store	*r;
 	struct fast_pool	*fast_pool = this_cpu_ptr(&irq_randomness);
drivers/hv/vmbus_drv.c +1 -1
index bc65c4d79c1f..777096d560cb 100644
@@ -1016,7 +1016,7 @@ static void vmbus_isr(void)
 			tasklet_schedule(&hv_cpu->msg_dpc);
 	}
 
-	add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0);
+	add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR);
 }
 
 
include/linux/random.h +1 -1
index 4024f7d9c77d..b71f87dbf7cd 100644
@@ -32,7 +32,7 @@ static inline void add_latent_entropy(void) {}
 
 extern void add_input_randomness(unsigned int type, unsigned int code,
 				 unsigned int value) __latent_entropy;
-extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
+extern void add_interrupt_randomness(int irq) __latent_entropy;
 
 extern void get_random_bytes(void *buf, int nbytes);
 extern int wait_for_random_bytes(void);
kernel/irq/handle.c +1 -1
index 79f987b942b8..1bc4dcc489d0 100644
@@ -186,7 +186,7 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
 
 	retval = __handle_irq_event_percpu(desc, &flags);
 
-	add_interrupt_randomness(desc->irq_data.irq, flags);
+	add_interrupt_randomness(desc->irq_data.irq);
 
 	if (!noirqdebug)
 		note_interrupt(desc, retval);
Signature · 1 line
2.14.1
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi Sultan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Sultan-Alsawaf/random-remove-unused-argument-from-add_interrupt_randomness/20180430-111445
config: i386-randconfig-x013-201817 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

drivers/hv/hv.c: In function 'hv_stimer0_isr':

>> drivers/hv/hv.c:118:2: error: too many arguments to function 'add_interrupt_randomness'
     add_interrupt_randomness(stimer0_vector, 0);
     ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hv/hv.c:30:0:
   include/linux/random.h:35:13: note: declared here
    extern void add_interrupt_randomness(int irq) __latent_entropy;
                ^~~~~~~~~~~~~~~~~~~~~~~~

vim +/add_interrupt_randomness +118 drivers/hv/hv.c

3e7ee490 drivers/staging/hv/Hv.c Hank Janssen   2009-07-13  105  
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  106  /*
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  107   * ISR for when stimer0 is operating in Direct Mode.  Direct Mode
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  108   * does not use VMbus or any VMbus messages, so process here and not
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  109   * in the VMbus driver code.
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  110   */
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  111  
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  112  static void hv_stimer0_isr(void)
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  113  {
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  114  	struct hv_per_cpu_context *hv_cpu;
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  115  
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  116  	hv_cpu = this_cpu_ptr(hv_context.cpu_context);
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  117  	hv_cpu->clk_evt->event_handler(hv_cpu->clk_evt);
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04 @118  	add_interrupt_randomness(stimer0_vector, 0);
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  119  }
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  120  

:::::: The code at line 118 was first introduced by commit
:::::: 248e742a396e7f00b283f1c56e14b1bef6e3ec56 Drivers: hv: vmbus: Implement Direct Mode for stimer0

:::::: TO: Michael Kelley <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Sultan Alsawaf
Thank you for the patch! Perhaps something to improve:

Hi Sultan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Sultan-Alsawaf/random-remove-unused-argument-from-add_interrupt_randomness/20180430-111445
reproduce:

        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__

sparse warnings: (new ones prefixed by >>)

>> drivers/hv/hv.c:118:33: sparse: too many arguments for function add_interrupt_randomness
   drivers/hv/hv.c: In function 'hv_stimer0_isr':
   drivers/hv/hv.c:118:2: error: too many arguments to function 'add_interrupt_randomness'
     add_interrupt_randomness(stimer0_vector, 0);
     ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hv/hv.c:30:0:
   include/linux/random.h:35:13: note: declared here
    extern void add_interrupt_randomness(int irq) __latent_entropy;
                ^~~~~~~~~~~~~~~~~~~~~~~~

vim +118 drivers/hv/hv.c

3e7ee490 drivers/staging/hv/Hv.c Hank Janssen   2009-07-13  105  
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  106  /*
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  107   * ISR for when stimer0 is operating in Direct Mode.  Direct Mode
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  108   * does not use VMbus or any VMbus messages, so process here and not
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  109   * in the VMbus driver code.
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  110   */
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  111  
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  112  static void hv_stimer0_isr(void)
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  113  {
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  114  	struct hv_per_cpu_context *hv_cpu;
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  115  
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  116  	hv_cpu = this_cpu_ptr(hv_context.cpu_context);
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  117  	hv_cpu->clk_evt->event_handler(hv_cpu->clk_evt);
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04 @118  	add_interrupt_randomness(stimer0_vector, 0);
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  119  }
248e742a drivers/hv/hv.c         Michael Kelley 2018-03-04  120  

:::::: The code at line 118 was first introduced by commit
:::::: 248e742a396e7f00b283f1c56e14b1bef6e3ec56 Drivers: hv: vmbus: Implement Direct Mode for stimer0

:::::: TO: Michael Kelley <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw
Quoted 1 line

From a872cf4f0bb57a7bb3c95ea557082fb7733344f8 Mon Sep 17 00:00:00 2001

From: Sultan Alsawaf <[email protected]>
Date: Sun, 29 Apr 2018 20:04:35 -0700
Subject: [PATCH] random: remove unused argument from
add_interrupt_randomness()

The irq_flags parameter is not used. Remove it.

---
 drivers/char/random.c  | 4 ++--
 drivers/hv/hv.c        | 2 +-
 drivers/hv/vmbus_drv.c | 2 +-
 include/linux/random.h | 2 +-
 kernel/irq/handle.c    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
drivers/char/random.c +2 -2
index 3cd3aae24d6d..125c1f545277 100644
@@ -131,7 +131,7 @@
  *	void add_device_randomness(const void *buf, unsigned int size);
  * 	void add_input_randomness(unsigned int type, unsigned int code,
  *                                unsigned int value);
- *	void add_interrupt_randomness(int irq, int irq_flags);
+ *	void add_interrupt_randomness(int irq);
  * 	void add_disk_randomness(struct gendisk *disk);
  *
  * add_device_randomness() is for adding data to the random pool that
@@ -1189,7 +1189,7 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
 	return *ptr;
 }
 
-void add_interrupt_randomness(int irq, int irq_flags)
+void add_interrupt_randomness(int irq)
 {
 	struct entropy_store	*r;
 	struct fast_pool	*fast_pool = this_cpu_ptr(&irq_randomness);
drivers/hv/hv.c +1 -1
index 9b82549cbbc8..4b76ba23d666 100644
@@ -115,7 +115,7 @@ static void hv_stimer0_isr(void)
 
 	hv_cpu = this_cpu_ptr(hv_context.cpu_context);
 	hv_cpu->clk_evt->event_handler(hv_cpu->clk_evt);
-	add_interrupt_randomness(stimer0_vector, 0);
+	add_interrupt_randomness(stimer0_vector);
 }
 
 static int hv_ce_set_next_event(unsigned long delta,
drivers/hv/vmbus_drv.c +1 -1
index b10fe26c4891..41f4116f8c31 100644
@@ -1015,7 +1015,7 @@ static void vmbus_isr(void)
 			tasklet_schedule(&hv_cpu->msg_dpc);
 	}
 
-	add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0);
+	add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR);
 }
 
 
include/linux/random.h +1 -1
index 2ddf13b4281e..210400258fef 100644
@@ -32,7 +32,7 @@ static inline void add_latent_entropy(void) {}
 
 extern void add_input_randomness(unsigned int type, unsigned int code,
 				 unsigned int value) __latent_entropy;
-extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
+extern void add_interrupt_randomness(int irq) __latent_entropy;
 
 extern void get_random_bytes(void *buf, int nbytes);
 extern int wait_for_random_bytes(void);
kernel/irq/handle.c +1 -1
index 38554bc35375..e2f7afcb1ae6 100644
@@ -188,7 +188,7 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
 
 	retval = __handle_irq_event_percpu(desc, &flags);
 
-	add_interrupt_randomness(desc->irq_data.irq, flags);
+	add_interrupt_randomness(desc->irq_data.irq);
 
 	if (!noirqdebug)
 		note_interrupt(desc, retval);
Signature · 1 line
2.14.1
#4 lore raw

This is still an issue in the latest kernel version.

Sultan

Quoted 94 lines · Sultan Alsawaf

From a872cf4f0bb57a7bb3c95ea557082fb7733344f8 Mon Sep 17 00:00:00 2001
From: Sultan Alsawaf <[email protected]>
Date: Sun, 29 Apr 2018 20:04:35 -0700
Subject: [PATCH] random: remove unused argument from
add_interrupt_randomness()

The irq_flags parameter is not used. Remove it.

---
 drivers/char/random.c  | 4 ++--
 drivers/hv/hv.c        | 2 +-
 drivers/hv/vmbus_drv.c | 2 +-
 include/linux/random.h | 2 +-
 kernel/irq/handle.c    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
drivers/char/random.c +2 -2
index 3cd3aae24d6d..125c1f545277 100644
@@ -131,7 +131,7 @@
  *     void add_device_randomness(const void *buf, unsigned int size);
  *     void add_input_randomness(unsigned int type, unsigned int code,
  *                                unsigned int value);
- *     void add_interrupt_randomness(int irq, int irq_flags);
+ *     void add_interrupt_randomness(int irq);
  *     void add_disk_randomness(struct gendisk *disk);
  *
  * add_device_randomness() is for adding data to the random pool that
@@ -1189,7 +1189,7 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
        return *ptr;
 }
 
-void add_interrupt_randomness(int irq, int irq_flags)
+void add_interrupt_randomness(int irq)
 {
        struct entropy_store    *r;
        struct fast_pool        *fast_pool = this_cpu_ptr(&irq_randomness);
drivers/hv/hv.c +1 -1
index 9b82549cbbc8..4b76ba23d666 100644
@@ -115,7 +115,7 @@ static void hv_stimer0_isr(void)
 
        hv_cpu = this_cpu_ptr(hv_context.cpu_context);
        hv_cpu->clk_evt->event_handler(hv_cpu->clk_evt);
-       add_interrupt_randomness(stimer0_vector, 0);
+       add_interrupt_randomness(stimer0_vector);
 }
 
 static int hv_ce_set_next_event(unsigned long delta,
drivers/hv/vmbus_drv.c +1 -1
index b10fe26c4891..41f4116f8c31 100644
@@ -1015,7 +1015,7 @@ static void vmbus_isr(void)
                        tasklet_schedule(&hv_cpu->msg_dpc);
        }
 
-       add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0);
+       add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR);
 }
 
 
include/linux/random.h +1 -1
index 2ddf13b4281e..210400258fef 100644
@@ -32,7 +32,7 @@ static inline void add_latent_entropy(void) {}
 
 extern void add_input_randomness(unsigned int type, unsigned int code,
                                 unsigned int value) __latent_entropy;
-extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
+extern void add_interrupt_randomness(int irq) __latent_entropy;
 
 extern void get_random_bytes(void *buf, int nbytes);
 extern int wait_for_random_bytes(void);
kernel/irq/handle.c +1 -2
index 38554bc35375..e2f7afcb1ae6 100644
@@ -188,7 +188,7 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
 
        retval = __handle_irq_event_percpu(desc, &flags);
 
-       add_interrupt_randomness(desc->irq_data.irq, flags);
+       add_interrupt_randomness(desc->irq_data.irq);
 
        if (!noirqdebug)
                note_interrupt(desc, retval);
--

2.14.1