diff mbox

[RFC,v1,14/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Message ID 1432116013-25902-15-git-send-email-jiang.liu@linux.intel.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Jiang Liu May 20, 2015, 10 a.m. UTC
Now most IRQ flow handlers make no use of the first parameter 'irq'.
And for those who do make use of 'irq', we could easily get the irq
number through irq_desc->irq_data->irq. So kill the first parameter
'irq' of irq_flow_handler_t.

To ease review, I have split the changes into several parts, though
they should be merge as one to support bisecting.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
 include/linux/irq.h        |   16 ++++++++--------
 include/linux/irqdesc.h    |    9 +++++++--
 include/linux/irqhandler.h |    2 +-
 kernel/irq/chip.c          |   22 ++++++++--------------
 kernel/irq/handle.c        |    4 ++--
 kernel/irq/irqdesc.c       |    2 +-
 6 files changed, 27 insertions(+), 28 deletions(-)

Comments

Thomas Gleixner May 20, 2015, 3:25 p.m. UTC | #1
On Wed, 20 May 2015, Jiang Liu wrote:
> --- a/include/linux/irqdesc.h
> +++ b/include/linux/irqdesc.h
> @@ -99,6 +99,11 @@ static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
>  	return container_of(data->common, struct irq_desc, irq_common_data);
>  }
>  
> +static inline unsigned int irq_desc_get_irq(struct irq_desc *desc)
> +{
> +	return desc->irq_data.irq;
> +}
> +

Does not apply either.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiang Liu May 20, 2015, 3:28 p.m. UTC | #2
On 2015/5/20 23:25, Thomas Gleixner wrote:
> On Wed, 20 May 2015, Jiang Liu wrote:
>> --- a/include/linux/irqdesc.h
>> +++ b/include/linux/irqdesc.h
>> @@ -99,6 +99,11 @@ static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
>>  	return container_of(data->common, struct irq_desc, irq_common_data);
>>  }
>>  
>> +static inline unsigned int irq_desc_get_irq(struct irq_desc *desc)
>> +{
>> +	return desc->irq_data.irq;
>> +}
>> +
> 
> Does not apply either.
Hi Thomas,
	Will check the base again.
	Please do not apply patch after [14/25]. There are here to
ask for comments, there are still building issues with patch after
[14/25]. Just help to comment whether it's on the right direction.
If so, I will send another version for formal review.
Thanks!
Gerry

> 
> Thanks,
> 
> 	tglx
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Gleixner May 20, 2015, 6:35 p.m. UTC | #3
B1;2802;0cOn Wed, 20 May 2015, Jiang Liu wrote:
> On 2015/5/20 23:25, Thomas Gleixner wrote:
> > On Wed, 20 May 2015, Jiang Liu wrote:
> >> --- a/include/linux/irqdesc.h
> >> +++ b/include/linux/irqdesc.h
> >> @@ -99,6 +99,11 @@ static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
> >>  	return container_of(data->common, struct irq_desc, irq_common_data);
> >>  }
> >>  
> >> +static inline unsigned int irq_desc_get_irq(struct irq_desc *desc)
> >> +{
> >> +	return desc->irq_data.irq;
> >> +}
> >> +
> > 
> > Does not apply either.
> Hi Thomas,
> 	Will check the base again.
> 	Please do not apply patch after [14/25]. There are here to
> ask for comments, there are still building issues with patch after
> [14/25]. Just help to comment whether it's on the right direction.
> If so, I will send another version for formal review.

I think you are doing that conversion wrong. You should first change
all handlers which use the irq argument to:

    handler(unsigned __irq, *desc)

and add the local variable 

    unsigned irq;

or
	
    unsigned irq = irq_desc_get_irq(desc);

for those.

So that results in a pretty small series of patches.

Once that is done, you can remove the irq argument in one go treewide.

And you should do that with scripting aid. Coccinelle is the proper
tool for this. If you have problems with cocci, you can politely ask
Julia (Cc'ed) for help. She's the master of coccinelle :)

The purpose of the script is to:

    1) Identify all handlers

       This can be done by analyzing the arguments of

       	    __irq_set_handler()
	    irq_set_handler()
	    irq_set_chained_handler()
	    irq_alloc_generic_chip()
	    irq_alloc_domain_generic_chips()
	    irq_set_chip_and_handler_name()
	    irq_set_chip_and_handler()
	    __irq_set_handler_locked()
	    __irq_set_chip_handler_name_locked()
	    __irq_set_preflow_handler()

	If the argument is a function local to the file step 2 can
	take place.

	If it's a extern function, then the script should at least
	print out the function names. Those are in most of the cases
	the generic flow handler functions.

    2) Check the handlers whether they use the irq argument

       For those which do:

          Check whether they just use the argument instead of a local
       	  variable, i.e. the first usage is an assignment. In that
       	  case rename the argument to __irq and add a local variable
       	  
	      unsigned int irq;

	  If they use the irq argument for some computation or as
       	  argument to another function, then you need to rename the
       	  argument as well and add:

       	      unsigned int irq = irq_get_desc_irq(desc);

So this results in a series of patches which can be merged right
away. If that lot has hit Linus tree and right after -rc1, we run the
script again and find and fix stuff which got added throughout the
merge window. That might result in 0 to n patches.

The last step is another script which does:

    1) Identify all handlers

    2) Remove the irq argument

We can send that right after -rc1 so no new users can trickle in.

It's really important to do that with scripts. It seems you try to do
it via compile testing. But that will fail as you CANNOT execute all
possible config combinations.

Thanks,

	tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Gleixner May 20, 2015, 6:36 p.m. UTC | #4
On Wed, 20 May 2015, Jiang Liu wrote:

> On 2015/5/20 23:25, Thomas Gleixner wrote:
> > On Wed, 20 May 2015, Jiang Liu wrote:
> >> --- a/include/linux/irqdesc.h
> >> +++ b/include/linux/irqdesc.h
> >> @@ -99,6 +99,11 @@ static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
> >>  	return container_of(data->common, struct irq_desc, irq_common_data);
> >>  }
> >>  
> >> +static inline unsigned int irq_desc_get_irq(struct irq_desc *desc)
> >> +{
> >> +	return desc->irq_data.irq;
> >> +}
> >> +
> > 
> > Does not apply either.
> Hi Thomas,
> 	Will check the base again.

I assume you applied it on top of the common data split. See the hunk
above.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julia Lawall May 20, 2015, 8 p.m. UTC | #5
On Wed, 20 May 2015, Thomas Gleixner wrote:

> B1;2802;0cOn Wed, 20 May 2015, Jiang Liu wrote:
> > On 2015/5/20 23:25, Thomas Gleixner wrote:
> > > On Wed, 20 May 2015, Jiang Liu wrote:
> > >> --- a/include/linux/irqdesc.h
> > >> +++ b/include/linux/irqdesc.h
> > >> @@ -99,6 +99,11 @@ static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
> > >>  	return container_of(data->common, struct irq_desc, irq_common_data);
> > >>  }
> > >>
> > >> +static inline unsigned int irq_desc_get_irq(struct irq_desc *desc)
> > >> +{
> > >> +	return desc->irq_data.irq;
> > >> +}
> > >> +
> > >
> > > Does not apply either.
> > Hi Thomas,
> > 	Will check the base again.
> > 	Please do not apply patch after [14/25]. There are here to
> > ask for comments, there are still building issues with patch after
> > [14/25]. Just help to comment whether it's on the right direction.
> > If so, I will send another version for formal review.
>
> I think you are doing that conversion wrong. You should first change
> all handlers which use the irq argument to:
>
>     handler(unsigned __irq, *desc)
>
> and add the local variable
>
>     unsigned irq;
>
> or
>
>     unsigned irq = irq_desc_get_irq(desc);
>
> for those.
>
> So that results in a pretty small series of patches.
>
> Once that is done, you can remove the irq argument in one go treewide.
>
> And you should do that with scripting aid. Coccinelle is the proper
> tool for this. If you have problems with cocci, you can politely ask
> Julia (Cc'ed) for help. She's the master of coccinelle :)
>
> The purpose of the script is to:
>
>     1) Identify all handlers
>
>        This can be done by analyzing the arguments of
>
>        	    __irq_set_handler()
> 	    irq_set_handler()
> 	    irq_set_chained_handler()
> 	    irq_alloc_generic_chip()
> 	    irq_alloc_domain_generic_chips()
> 	    irq_set_chip_and_handler_name()
> 	    irq_set_chip_and_handler()
> 	    __irq_set_handler_locked()
> 	    __irq_set_chip_handler_name_locked()
> 	    __irq_set_preflow_handler()
>
> 	If the argument is a function local to the file step 2 can
> 	take place.
>
> 	If it's a extern function, then the script should at least
> 	print out the function names. Those are in most of the cases
> 	the generic flow handler functions.

Looks reasonable.

>     2) Check the handlers whether they use the irq argument
>
>        For those which do:
>
>           Check whether they just use the argument instead of a local
>        	  variable, i.e. the first usage is an assignment. In that
>        	  case rename the argument to __irq and add a local variable
>
> 	      unsigned int irq;
>
> 	  If they use the irq argument for some computation or as
>        	  argument to another function, then you need to rename the
>        	  argument as well and add:
>
>        	      unsigned int irq = irq_get_desc_irq(desc);

Scripting this may be a little complex, because the variable can be used
in one way in one execution path (eg if branch) and another way (or not at
all) in another.  Let me know if help is needed.

julia

> So this results in a series of patches which can be merged right
> away. If that lot has hit Linus tree and right after -rc1, we run the
> script again and find and fix stuff which got added throughout the
> merge window. That might result in 0 to n patches.
>
> The last step is another script which does:
>
>     1) Identify all handlers
>
>     2) Remove the irq argument
>
> We can send that right after -rc1 so no new users can trickle in.
>
> It's really important to do that with scripts. It seems you try to do
> it via compile testing. But that will fail as you CANNOT execute all
> possible config combinations.
>
> Thanks,
>
> 	tglx
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Gleixner May 20, 2015, 8:12 p.m. UTC | #6
On Wed, 20 May 2015, Julia Lawall wrote:
> On Wed, 20 May 2015, Thomas Gleixner wrote:
> > The purpose of the script is to:
> >
> >     1) Identify all handlers
> >
> >        This can be done by analyzing the arguments of
> >
> >        	    __irq_set_handler()
> > 	    irq_set_handler()
> > 	    irq_set_chained_handler()
> > 	    irq_alloc_generic_chip()
> > 	    irq_alloc_domain_generic_chips()
> > 	    irq_set_chip_and_handler_name()
> > 	    irq_set_chip_and_handler()
> > 	    __irq_set_handler_locked()
> > 	    __irq_set_chip_handler_name_locked()
> > 	    __irq_set_preflow_handler()
> >
> > 	If the argument is a function local to the file step 2 can
> > 	take place.
> >
> > 	If it's a extern function, then the script should at least
> > 	print out the function names. Those are in most of the cases
> > 	the generic flow handler functions.
> 
> Looks reasonable.

Good.
 
> >     2) Check the handlers whether they use the irq argument
> >
> >        For those which do:
> >
> >           Check whether they just use the argument instead of a local
> >        	  variable, i.e. the first usage is an assignment. In that
> >        	  case rename the argument to __irq and add a local variable
> >
> > 	      unsigned int irq;
> >
> > 	  If they use the irq argument for some computation or as
> >        	  argument to another function, then you need to rename the
> >        	  argument as well and add:
> >
> >        	      unsigned int irq = irq_get_desc_irq(desc);
> 
> Scripting this may be a little complex, because the variable can be used
> in one way in one execution path (eg if branch) and another way (or not at
> all) in another.  Let me know if help is needed.

I feared that, but at least identifying all functions, where the irq
argument is used inside the function itself is really key for such a
massive rework.

Thanks for responding so quick!

	tglx


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julia Lawall May 20, 2015, 8:15 p.m. UTC | #7
On Wed, 20 May 2015, Thomas Gleixner wrote:

> On Wed, 20 May 2015, Julia Lawall wrote:
> > On Wed, 20 May 2015, Thomas Gleixner wrote:
> > > The purpose of the script is to:
> > >
> > >     1) Identify all handlers
> > >
> > >        This can be done by analyzing the arguments of
> > >
> > >        	    __irq_set_handler()
> > > 	    irq_set_handler()
> > > 	    irq_set_chained_handler()
> > > 	    irq_alloc_generic_chip()
> > > 	    irq_alloc_domain_generic_chips()
> > > 	    irq_set_chip_and_handler_name()
> > > 	    irq_set_chip_and_handler()
> > > 	    __irq_set_handler_locked()
> > > 	    __irq_set_chip_handler_name_locked()
> > > 	    __irq_set_preflow_handler()
> > >
> > > 	If the argument is a function local to the file step 2 can
> > > 	take place.
> > >
> > > 	If it's a extern function, then the script should at least
> > > 	print out the function names. Those are in most of the cases
> > > 	the generic flow handler functions.
> >
> > Looks reasonable.
>
> Good.
>
> > >     2) Check the handlers whether they use the irq argument
> > >
> > >        For those which do:
> > >
> > >           Check whether they just use the argument instead of a local
> > >        	  variable, i.e. the first usage is an assignment. In that
> > >        	  case rename the argument to __irq and add a local variable
> > >
> > > 	      unsigned int irq;
> > >
> > > 	  If they use the irq argument for some computation or as
> > >        	  argument to another function, then you need to rename the
> > >        	  argument as well and add:
> > >
> > >        	      unsigned int irq = irq_get_desc_irq(desc);
> >
> > Scripting this may be a little complex, because the variable can be used
> > in one way in one execution path (eg if branch) and another way (or not at
> > all) in another.  Let me know if help is needed.
>
> I feared that, but at least identifying all functions, where the irq
> argument is used inside the function itself is really key for such a
> massive rework.

It's not impossible, but I may need to think a bit how best to do it.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Gleixner May 20, 2015, 8:22 p.m. UTC | #8
On Wed, 20 May 2015, Julia Lawall wrote:
> On Wed, 20 May 2015, Thomas Gleixner wrote:
> > On Wed, 20 May 2015, Julia Lawall wrote:
> > > Scripting this may be a little complex, because the variable can be used
> > > in one way in one execution path (eg if branch) and another way (or not at
> > > all) in another.  Let me know if help is needed.
> >
> > I feared that, but at least identifying all functions, where the irq
> > argument is used inside the function itself is really key for such a
> > massive rework.
> 
> It's not impossible, but I may need to think a bit how best to do it.

I pretty much expected that you would say that :)

But seriously, the first important thing is to find all functions and
to check whether they use irq internaly. Jiang has done that
'manually' or such, so the number of function which need an actual
change are not that big.

But I certainly don't want to hold you off thinking about it. Such
stuff is not a unique problem :)

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julia Lawall June 12, 2015, 8:29 p.m. UTC | #9
On Wed, 20 May 2015, Thomas Gleixner wrote:

> On Wed, 20 May 2015, Julia Lawall wrote:
> > On Wed, 20 May 2015, Thomas Gleixner wrote:
> > > On Wed, 20 May 2015, Julia Lawall wrote:
> > > > Scripting this may be a little complex, because the variable can be used
> > > > in one way in one execution path (eg if branch) and another way (or not at
> > > > all) in another.  Let me know if help is needed.
> > >
> > > I feared that, but at least identifying all functions, where the irq
> > > argument is used inside the function itself is really key for such a
> > > massive rework.
> > 
> > It's not impossible, but I may need to think a bit how best to do it.
> 
> I pretty much expected that you would say that :)
> 
> But seriously, the first important thing is to find all functions and
> to check whether they use irq internaly. Jiang has done that
> 'manually' or such, so the number of function which need an actual
> change are not that big.
> 
> But I certainly don't want to hold you off thinking about it. Such
> stuff is not a unique problem :)

What is the status of this?  I am close to having a semantic patch that 
works.  The current version touches 133 files, but I haven't checked all 
of them.  This includes both the local functions and the generic ones, but 
not the cases where the name of the handler function is a local variable 
or arbitrary expression.  This occurs in around 30 files.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Gleixner June 12, 2015, 8:35 p.m. UTC | #10
On Fri, 12 Jun 2015, Julia Lawall wrote:
> What is the status of this?  I am close to having a semantic patch that 
> works.  The current version touches 133 files, but I haven't checked all 
> of them.  This includes both the local functions and the generic ones, but 
> not the cases where the name of the handler function is a local variable 
> or arbitrary expression.  This occurs in around 30 files.

Jiang sent out a new patch series, but I'm really interested in doing
a fully automated check. If conversion is possible for some of them,
fine, but the checking part to find all the places where this needs to
be applied is the most important to me.

If you want, just send me that script and I'll give it a test ride.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julia Lawall June 13, 2015, 8:27 a.m. UTC | #11
>     unsigned irq = irq_desc_get_irq(desc);

Actually, I put the wrong name for this in my semantic patch.  I will send
a new version and new results shortly.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julia Lawall June 13, 2015, 9 a.m. UTC | #12
>     unsigned irq = irq_desc_get_irq(desc);

Actually, it seems that this function doesn't exist in linux-next either.
What is the correct name of the function, or is there some other tree that
I should be working on?

thanks,
julia
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 657ccd03f94d..e843d31c2e68 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -458,14 +458,14 @@  static inline int irq_set_parent(int irq, int parent_irq)
  * Built-in IRQ handlers for various IRQ types,
  * callable via desc->handle_irq()
  */
-extern void handle_level_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
+extern void handle_level_irq(struct irq_desc *desc);
+extern void handle_fasteoi_irq(struct irq_desc *desc);
+extern void handle_edge_irq(struct irq_desc *desc);
+extern void handle_edge_eoi_irq(struct irq_desc *desc);
+extern void handle_simple_irq(struct irq_desc *desc);
+extern void handle_percpu_irq(struct irq_desc *desc);
+extern void handle_percpu_devid_irq(struct irq_desc *desc);
+extern void handle_bad_irq(struct irq_desc *desc);
 extern void handle_nested_irq(unsigned int irq);
 
 extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 8f649e174ed1..90b1e51a46c3 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -99,6 +99,11 @@  static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
 	return container_of(data->common, struct irq_desc, irq_common_data);
 }
 
+static inline unsigned int irq_desc_get_irq(struct irq_desc *desc)
+{
+	return desc->irq_data.irq;
+}
+
 static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc)
 {
 	return &desc->irq_data;
@@ -130,9 +135,9 @@  static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
  * irqchip-style controller then we call the ->handle_irq() handler,
  * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
  */
-static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
+static inline void generic_handle_irq_desc(struct irq_desc *desc)
 {
-	desc->handle_irq(irq, desc);
+	desc->handle_irq(desc);
 }
 
 int generic_handle_irq(unsigned int irq);
diff --git a/include/linux/irqhandler.h b/include/linux/irqhandler.h
index 62d543004197..661bed0ed1f3 100644
--- a/include/linux/irqhandler.h
+++ b/include/linux/irqhandler.h
@@ -8,7 +8,7 @@ 
 
 struct irq_desc;
 struct irq_data;
-typedef	void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc);
+typedef	void (*irq_flow_handler_t)(struct irq_desc *desc);
 typedef	void (*irq_preflow_handler_t)(struct irq_data *data);
 
 #endif
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index fada8daa6b19..66494babfcdd 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -372,7 +372,6 @@  static bool irq_may_run(struct irq_desc *desc)
 
 /**
  *	handle_simple_irq - Simple and software-decoded IRQs.
- *	@irq:	the interrupt number
  *	@desc:	the interrupt description structure for this irq
  *
  *	Simple interrupts are either sent from a demultiplexing interrupt
@@ -383,7 +382,7 @@  static bool irq_may_run(struct irq_desc *desc)
  *	unmask issues if necessary.
  */
 void
-handle_simple_irq(unsigned int irq, struct irq_desc *desc)
+handle_simple_irq(struct irq_desc *desc)
 {
 	raw_spin_lock(&desc->lock);
 
@@ -425,7 +424,6 @@  static void cond_unmask_irq(struct irq_desc *desc)
 
 /**
  *	handle_level_irq - Level type irq handler
- *	@irq:	the interrupt number
  *	@desc:	the interrupt description structure for this irq
  *
  *	Level type interrupts are active as long as the hardware line has
@@ -434,7 +432,7 @@  static void cond_unmask_irq(struct irq_desc *desc)
  *	interrupt line is back to inactive.
  */
 void
-handle_level_irq(unsigned int irq, struct irq_desc *desc)
+handle_level_irq(struct irq_desc *desc)
 {
 	raw_spin_lock(&desc->lock);
 	mask_ack_irq(desc);
@@ -496,7 +494,6 @@  static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
 
 /**
  *	handle_fasteoi_irq - irq handler for transparent controllers
- *	@irq:	the interrupt number
  *	@desc:	the interrupt description structure for this irq
  *
  *	Only a single callback will be issued to the chip: an ->eoi()
@@ -505,7 +502,7 @@  static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
  *	details in hardware, transparently.
  */
 void
-handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
+handle_fasteoi_irq(struct irq_desc *desc)
 {
 	struct irq_chip *chip = desc->irq_data.chip;
 
@@ -546,7 +543,6 @@  EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
 
 /**
  *	handle_edge_irq - edge type IRQ handler
- *	@irq:	the interrupt number
  *	@desc:	the interrupt description structure for this irq
  *
  *	Interrupt occures on the falling and/or rising edge of a hardware
@@ -561,7 +557,7 @@  EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
  *	loop is left.
  */
 void
-handle_edge_irq(unsigned int irq, struct irq_desc *desc)
+handle_edge_irq(struct irq_desc *desc)
 {
 	raw_spin_lock(&desc->lock);
 
@@ -618,13 +614,12 @@  EXPORT_SYMBOL(handle_edge_irq);
 #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER
 /**
  *	handle_edge_eoi_irq - edge eoi type IRQ handler
- *	@irq:	the interrupt number
  *	@desc:	the interrupt description structure for this irq
  *
  * Similar as the above handle_edge_irq, but using eoi and w/o the
  * mask/unmask logic.
  */
-void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc)
+void handle_edge_eoi_irq(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 
@@ -665,13 +660,12 @@  out_eoi:
 
 /**
  *	handle_percpu_irq - Per CPU local irq handler
- *	@irq:	the interrupt number
  *	@desc:	the interrupt description structure for this irq
  *
  *	Per CPU interrupts on SMP machines without locking requirements
  */
 void
-handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
+handle_percpu_irq(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 
@@ -688,7 +682,6 @@  handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
 
 /**
  * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids
- * @irq:	the interrupt number
  * @desc:	the interrupt description structure for this irq
  *
  * Per CPU interrupts on SMP machines without locking requirements. Same as
@@ -698,11 +691,12 @@  handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
  * contain the real device id for the cpu on which this handler is
  * called
  */
-void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc)
+void handle_percpu_devid_irq(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct irqaction *action = desc->action;
 	void *dev_id = raw_cpu_ptr(action->percpu_dev_id);
+	unsigned int irq = irq_desc_get_irq(desc);
 	irqreturn_t res;
 
 	kstat_incr_irqs_this_cpu(desc);
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 4d37b96343e9..b896a6ad8722 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -22,13 +22,13 @@ 
 
 /**
  * handle_bad_irq - handle spurious and unhandled irqs
- * @irq:       the interrupt number
  * @desc:      description of the interrupt
  *
  * Handles spurious and unhandled IRQ's. It also prints a debugmessage.
  */
-void handle_bad_irq(unsigned int irq, struct irq_desc *desc)
+void handle_bad_irq(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_get_irq(desc);
 	print_irq_desc(irq, desc);
 	kstat_incr_irqs_this_cpu(desc);
 	ack_bad_irq(irq);
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 500e6fd11d78..6a9db594133d 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -347,7 +347,7 @@  int generic_handle_irq(unsigned int irq)
 
 	if (!desc)
 		return -EINVAL;
-	generic_handle_irq_desc(irq, desc);
+	generic_handle_irq_desc(desc);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(generic_handle_irq);