From patchwork Mon Dec 7 09:46:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Palix X-Patchwork-Id: 65480 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB79kY63021303 for ; Mon, 7 Dec 2009 09:46:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934838AbZLGJq0 (ORCPT ); Mon, 7 Dec 2009 04:46:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934825AbZLGJqZ (ORCPT ); Mon, 7 Dec 2009 04:46:25 -0500 Received: from mgw1.diku.dk ([130.225.96.91]:38968 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759298AbZLGJqX convert rfc822-to-8bit (ORCPT ); Mon, 7 Dec 2009 04:46:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 77296770007; Mon, 7 Dec 2009 10:46:29 +0100 (CET) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PB4PR1dMxsRy; Mon, 7 Dec 2009 10:46:27 +0100 (CET) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id 78F3B52C337; Mon, 7 Dec 2009 10:46:27 +0100 (CET) Received: from npalix-pc.localnet (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 226406DF823; Mon, 7 Dec 2009 10:42:44 +0100 (CET) From: Nicolas Palix To: Paul Mundt , kernel-janitors@vger.kernel.org, Stuart Menefy , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] arch/sh: Replace an explicit computation by the use of the container_of macro Date: Mon, 7 Dec 2009 10:46:26 +0100 User-Agent: KMail/1.11.2 (Linux/2.6.28-17-generic; KDE/4.2.2; i686; ; ) MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200912071046.27330.npalix@diku.dk> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c index c1508a9..9282d96 100644 --- a/arch/sh/kernel/cpu/irq/ipr.c +++ b/arch/sh/kernel/cpu/irq/ipr.c @@ -17,16 +17,17 @@ * for more details. */ #include +#include +#include #include +#include #include -#include -#include #include static inline struct ipr_desc *get_ipr_desc(unsigned int irq) { struct irq_chip *chip = get_irq_chip(irq); - return (void *)((char *)chip - offsetof(struct ipr_desc, chip)); + return container_of(chip, struct ipr_desc, chip); } static void disable_ipr_irq(unsigned int irq)