From patchwork Mon Apr 3 19:46:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9660475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C31FF60364 for ; Mon, 3 Apr 2017 19:47:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3A0E205FC for ; Mon, 3 Apr 2017 19:47:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A84232811E; Mon, 3 Apr 2017 19:47:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5943126B41 for ; Mon, 3 Apr 2017 19:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752807AbdDCTrN (ORCPT ); Mon, 3 Apr 2017 15:47:13 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:33271 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752367AbdDCTrM (ORCPT ); Mon, 3 Apr 2017 15:47:12 -0400 Received: by mail-pg0-f48.google.com with SMTP id x125so129962012pgb.0 for ; Mon, 03 Apr 2017 12:47:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=j4bmVYicPmxA/my7bmpcGA7lAxGNOjuVMg2VAwQehRc=; b=Edfq32odQgcrIdjaJzUYTP5uG8lpH/bi6jIL8LL9EISCPDppvGGbnOJtnNBNs+gtdC 9MxEqXzCaWbWIU3gPWplDtzULd+0QOQqve0tgJfnzacyJ3cU8t3APTuDwIi8SdKYWXlB hXxpBzGl0W8Dcn0JQFvW4rcgpF1HqKAA9R7hhb9UlZEMX0VUjtMBd3PVel7Ya68vVnvW 3uGwqNoDpkRkgDc88WkIYIoF9fVVC7S3CPGT6i4aF/ZzQ3sZ6uMK37rZZdwHE+p/yER2 935VGWSpIJgpJw9l0q77R8YQgXM7e74hbLVmNeM7Iez0wBxnHgC97Sz0uoMKiFtIpuqc gEFg== X-Gm-Message-State: AFeK/H3KwDeF1Qp03qLCVhms9PUSB7adiLAAixUtdRNYlGv/fZVAKeQIvQsDdkZId1yk5fz9 X-Received: by 10.84.213.16 with SMTP id f16mr24206375pli.156.1491248826288; Mon, 03 Apr 2017 12:47:06 -0700 (PDT) Received: from mka.mtv.corp.google.com ([172.22.64.162]) by smtp.gmail.com with ESMTPSA id e7sm27503708pgp.2.2017.04.03.12.47.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 12:47:05 -0700 (PDT) From: Matthias Kaehlcke To: David Howells Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Matthias Kaehlcke Subject: [PATCH] frv: Use OFFSET macro in DEF_*REG() Date: Mon, 3 Apr 2017 12:46:36 -0700 Message-Id: <20170403194636.96438-1-mka@chromium.org> X-Mailer: git-send-email 2.12.2.564.g063fe858b8-goog Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid code duplication by using OFFSET() in DEF_*REG() instead of replicating the macro. Signed-off-by: Matthias Kaehlcke Reviewed-by: David Howells --- arch/frv/kernel/asm-offsets.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/frv/kernel/asm-offsets.c b/arch/frv/kernel/asm-offsets.c index 8414293f213a..20c5b79b55f9 100644 --- a/arch/frv/kernel/asm-offsets.c +++ b/arch/frv/kernel/asm-offsets.c @@ -14,21 +14,10 @@ #include #include -#define DEF_PTREG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct pt_regs, " #reg ")" \ - : : "i" (offsetof(struct pt_regs, reg))) - -#define DEF_IREG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \ - : : "i" (offsetof(struct user_context, reg))) - -#define DEF_FREG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \ - : : "i" (offsetof(struct user_context, reg))) - -#define DEF_0REG(sym, reg) \ - asm volatile("\n->" #sym " %0 offsetof(struct frv_frame0, " #reg ")" \ - : : "i" (offsetof(struct frv_frame0, reg))) +#define DEF_PTREG(sym, reg) OFFSET(sym, pt_regs, reg) +#define DEF_IREG(sym, reg) OFFSET(sym, user_context, reg) +#define DEF_FREG(sym, reg) OFFSET(sym, user_context, reg) +#define DEF_0REG(sym, reg) OFFSET(sym, frv_frame0, reg) void foo(void) {