From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754801AbbG0P7y (ORCPT ); Mon, 27 Jul 2015 11:59:54 -0400 Received: from terminus.zytor.com ([198.137.202.10]:36255 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754124AbbG0P7w (ORCPT ); Mon, 27 Jul 2015 11:59:52 -0400 Date: Mon, 27 Jul 2015 08:59:40 -0700 From: tip-bot for Jiang Liu Message-ID: Cc: tglx@linutronix.de, magnus.damm@gmail.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, jiang.liu@linux.intel.com, horms@verge.net.au Reply-To: tglx@linutronix.de, magnus.damm@gmail.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, horms@verge.net.au, jiang.liu@linux.intel.com In-Reply-To: <20150713151626.616384365@linutronix.de> References: <20150713151626.616384365@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] sh/irq: Use irq accessor functions instead of open coded access Git-Commit-ID: d1357bc730a5873aa6593883fe7eb4b94abb082e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d1357bc730a5873aa6593883fe7eb4b94abb082e Gitweb: http://git.kernel.org/tip/d1357bc730a5873aa6593883fe7eb4b94abb082e Author: Jiang Liu AuthorDate: Mon, 13 Jul 2015 20:51:22 +0000 Committer: Thomas Gleixner CommitDate: Mon, 27 Jul 2015 13:36:38 +0200 sh/irq: Use irq accessor functions instead of open coded access This is a preparatory patch for refactoring the internals if irq_data. Signed-off-by: Jiang Liu Cc: Simon Horman Cc: Magnus Damm Link: http://lkml.kernel.org/r/20150713151626.616384365@linutronix.de Signed-off-by: Thomas Gleixner --- drivers/sh/intc/virq.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index f5f1b82..0f73530 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c @@ -83,12 +83,11 @@ EXPORT_SYMBOL_GPL(intc_irq_lookup); static int add_virq_to_pirq(unsigned int irq, unsigned int virq) { - struct intc_virq_list **last, *entry; - struct irq_data *data = irq_get_irq_data(irq); + struct intc_virq_list *entry; + struct intc_virq_list **last = NULL; /* scan for duplicates */ - last = (struct intc_virq_list **)&data->handler_data; - for_each_virq(entry, data->handler_data) { + for_each_virq(entry, irq_get_handler_data(irq)) { if (entry->irq == virq) return 0; last = &entry->next; @@ -102,7 +101,10 @@ static int add_virq_to_pirq(unsigned int irq, unsigned int virq) entry->irq = virq; - *last = entry; + if (last) + *last = entry; + else + irq_set_handler_data(irq, entry); return 0; }