* [PATCH] gpio: brcmstb: Use list_for_each_entry at appropriate places
@ 2016-02-20 1:50 Axel Lin
2016-02-22 0:42 ` Gregory Fong
2016-02-25 9:29 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2016-02-20 1:50 UTC (permalink / raw)
To: Linus Walleij
Cc: Gregory Fong, bcm-kernel-feedback-list, Alexandre Courbot,
linux-gpio
Use list_for_each_entry to simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/gpio/gpio-brcmstb.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index d764425..42d51c5 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -233,17 +233,14 @@ static void brcmstb_gpio_irq_handler(struct irq_desc *desc)
struct gpio_chip *gc = irq_desc_get_handler_data(desc);
struct brcmstb_gpio_priv *priv = brcmstb_gpio_gc_to_priv(gc);
struct irq_chip *chip = irq_desc_get_chip(desc);
- struct list_head *pos;
+ struct brcmstb_gpio_bank *bank;
/* Interrupts weren't properly cleared during probe */
BUG_ON(!priv || !chip);
chained_irq_enter(chip, desc);
- list_for_each(pos, &priv->bank_list) {
- struct brcmstb_gpio_bank *bank =
- list_entry(pos, struct brcmstb_gpio_bank, node);
+ list_for_each_entry(bank, &priv->bank_list, node)
brcmstb_gpio_irq_bank_handler(bank);
- }
chained_irq_exit(chip, desc);
}
@@ -280,7 +277,6 @@ static int brcmstb_gpio_sanity_check_banks(struct device *dev,
static int brcmstb_gpio_remove(struct platform_device *pdev)
{
struct brcmstb_gpio_priv *priv = platform_get_drvdata(pdev);
- struct list_head *pos;
struct brcmstb_gpio_bank *bank;
int ret = 0;
@@ -293,10 +289,9 @@ static int brcmstb_gpio_remove(struct platform_device *pdev)
* You can lose return values below, but we report all errors, and it's
* more important to actually perform all of the steps.
*/
- list_for_each(pos, &priv->bank_list) {
- bank = list_entry(pos, struct brcmstb_gpio_bank, node);
+ list_for_each_entry(bank, &priv->bank_list, node)
gpiochip_remove(&bank->gc);
- }
+
if (priv->reboot_notifier.notifier_call) {
ret = unregister_reboot_notifier(&priv->reboot_notifier);
if (ret)
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] gpio: brcmstb: Use list_for_each_entry at appropriate places
2016-02-20 1:50 [PATCH] gpio: brcmstb: Use list_for_each_entry at appropriate places Axel Lin
@ 2016-02-22 0:42 ` Gregory Fong
2016-02-25 9:29 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Gregory Fong @ 2016-02-22 0:42 UTC (permalink / raw)
To: Axel Lin
Cc: Linus Walleij, bcm-kernel-feedback-list, Alexandre Courbot,
linux-gpio
On Fri, Feb 19, 2016 at 5:50 PM, Axel Lin <axel.lin@ingics.com> wrote:
> Use list_for_each_entry to simplify the code a bit.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
Thanks for the cleanup.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: brcmstb: Use list_for_each_entry at appropriate places
2016-02-20 1:50 [PATCH] gpio: brcmstb: Use list_for_each_entry at appropriate places Axel Lin
2016-02-22 0:42 ` Gregory Fong
@ 2016-02-25 9:29 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2016-02-25 9:29 UTC (permalink / raw)
To: Axel Lin
Cc: Gregory Fong, bcm-kernel-feedback-list, Alexandre Courbot,
linux-gpio@vger.kernel.org
On Sat, Feb 20, 2016 at 2:50 AM, Axel Lin <axel.lin@ingics.com> wrote:
> Use list_for_each_entry to simplify the code a bit.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Patch applied with Gregory's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-25 9:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-20 1:50 [PATCH] gpio: brcmstb: Use list_for_each_entry at appropriate places Axel Lin
2016-02-22 0:42 ` Gregory Fong
2016-02-25 9:29 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.