Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1692513
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Kiran Gunda <kgunda@codeaurora.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH V1 04/12] spmi: pmic-arb: optimize qpnpint_irq_set_type function |
| Date | Thu, 20 Jul 2017 09:40:06 +0200 |
| Message-ID | <u5ee2-46l-97@gated-at.bofh.it> (permalink) |
| References | <u5edY-46l-13@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1500535959; bh=fHiz4UwtApiOh2MlhDrnZHInkkz69TdzXIBo++vaqAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VMKf5tMY7yP1EhMyPy4MG7veGngrGq9u4oFnZeLZKQYT/EPpS4t5KhGs9meUExddo Kqv8ywlFoW/tkoKIO2YQltzVIRIhJInXBK7RuUKLDfs55/N5VbH8rQd+CBVFBBpKUa rTYfreSxyebuNiebYwSJiMs07SgeFFic/HEh7PYs= |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1500535958; bh=fHiz4UwtApiOh2MlhDrnZHInkkz69TdzXIBo++vaqAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6GVNjFw6rERdMrqxp5I/S2B0v8s/jXZZA7ajb2DxmW9fFnFXQzXqEPa6W7c/7/zZ hhVPecJYgJDgO3fx9hCNtBs6NzQQbymporYILtZYQ5DYAOift2SxCIZ4LDP9PCrr2b JGdpKyf6rUrpCu6h0/GfxVF+YHJl0m5aclRNZ92Q= |
| Dmarc-Filter | OpenDMARC Filter v1.3.2 smtp.codeaurora.org 85BFA6085C |
| Authentication-Results | pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org |
| Authentication-Results | pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kgunda@codeaurora.org |
| X-Mailer | git-send-email 1.9.1 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 63 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-arm-msm@vger.kernel.org |
| X-Original-Date | Thu, 20 Jul 2017 13:01:42 +0530 |
| X-Original-Message-ID | <1500535910-28705-5-git-send-email-kgunda@codeaurora.org> |
| X-Original-References | <1500535910-28705-1-git-send-email-kgunda@codeaurora.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1692513 |
Show key headers only | View raw
Optimize the qpnpint_irq_set_type() by using a local variable
to hold the handler type. Also clean up other variable usage.
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
---
drivers/spmi/spmi-pmic-arb.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index cd78665..0c98495 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -587,35 +587,35 @@ static void qpnpint_irq_unmask(struct irq_data *d)
static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type)
{
struct spmi_pmic_arb_qpnpint_type type;
+ irq_flow_handler_t flow_handler;
u8 irq = hwirq_to_irq(d->hwirq);
- u8 bit_mask_irq = BIT(irq);
qpnpint_spmi_read(d, QPNPINT_REG_SET_TYPE, &type, sizeof(type));
if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
- type.type |= bit_mask_irq;
+ type.type |= BIT(irq);
if (flow_type & IRQF_TRIGGER_RISING)
- type.polarity_high |= bit_mask_irq;
+ type.polarity_high |= BIT(irq);
if (flow_type & IRQF_TRIGGER_FALLING)
- type.polarity_low |= bit_mask_irq;
+ type.polarity_low |= BIT(irq);
+
+ flow_handler = handle_edge_irq;
} else {
if ((flow_type & (IRQF_TRIGGER_HIGH)) &&
(flow_type & (IRQF_TRIGGER_LOW)))
return -EINVAL;
- type.type &= ~bit_mask_irq; /* level trig */
+ type.type &= ~BIT(irq); /* level trig */
if (flow_type & IRQF_TRIGGER_HIGH)
- type.polarity_high |= bit_mask_irq;
+ type.polarity_high |= BIT(irq);
else
- type.polarity_low |= bit_mask_irq;
+ type.polarity_low |= BIT(irq);
+
+ flow_handler = handle_level_irq;
}
qpnpint_spmi_write(d, QPNPINT_REG_SET_TYPE, &type, sizeof(type));
-
- if (flow_type & IRQ_TYPE_EDGE_BOTH)
- irq_set_handler_locked(d, handle_edge_irq);
- else
- irq_set_handler_locked(d, handle_level_irq);
+ irq_set_handler_locked(d, flow_handler);
return 0;
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH V1 04/12] spmi: pmic-arb: optimize qpnpint_irq_set_type function Kiran Gunda <kgunda@codeaurora.org> - 2017-07-20 09:40 +0200 Re: [PATCH V1 04/12] spmi: pmic-arb: optimize qpnpint_irq_set_type function Stephen Boyd <sboyd@codeaurora.org> - 2017-07-28 01:50 +0200
csiph-web