diff options
author | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> | 2016-02-28 19:28:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-12 07:09:09 +0100 |
commit | eb66b2d301033e33c29fedffc6a317003d1e632c (patch) | |
tree | 2a61a40aaab72a2a18de9986574d8cfa027938e0 | |
parent | staging: fsl-mc: Drop unneeded void pointer cast (diff) | |
download | linux-eb66b2d301033e33c29fedffc6a317003d1e632c.tar.xz linux-eb66b2d301033e33c29fedffc6a317003d1e632c.zip |
staging: fsl-mc: bus: Eliminate double function call
A call to irq_find_matching_host was already made and the result
has been stored in mc_msi_domain. mc_msi_domain is again reassigned
using the same function call which is redundant.
irq_find_matching_host returns/locates a domain for a given fwnode.
The domain is identified using device node and bus_token(if several
domains have same device node but different purposes they can be
distinguished using bus-specific token).
http://www.bricktou.com/include/linux/irqdomain_irq_find_matching_host_en.html
Also, of_property_read_bool finds and reads a boolean from a property
device node from which the property value is to be read. It doesn't
alter the device node.
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/083698.html
Since, both the function calls have the same device node and bus_token,
the return values shall be the same. Hence, the second call has been
removed.
This was done using Coccinelle:
@r@
idexpression *x;
identifier f;
position p1,p2;
@@
x@p1 = f(...)
... when != x
(
x@p2 = f(...)
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
if (p1[0].line == p2[0].line):
cocci.include_match(False)
@@
idexpression *x;
identifier f;
position r.p1,r.p2;
@@
*x@p1 = f(...)
...
*x@p2 = f(...)
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c index 4e8e822da51d..720e2b018d00 100644 --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c @@ -118,8 +118,6 @@ void its_fsl_mc_msi_cleanup(void) if (!of_property_read_bool(np, "msi-controller")) continue; - mc_msi_domain = irq_find_matching_host(np, - DOMAIN_BUS_FSL_MC_MSI); if (mc_msi_domain && mc_msi_domain->host_data == &its_fsl_mc_msi_domain_info) irq_domain_remove(mc_msi_domain); |