Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3978619ybg; Mon, 28 Oct 2019 23:50:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzesrh/A/DnxDAyyhA/xISWZ4PEWrzM1o1vsazK4ZRbYBdv7DN/QU+Nm+8naCAfJy5lLZx4 X-Received: by 2002:aa7:cd64:: with SMTP id ca4mr16342577edb.121.1572331821362; Mon, 28 Oct 2019 23:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572331821; cv=none; d=google.com; s=arc-20160816; b=HinDo+VoVePYy/0ZuG3BVycwtBaFYk3mXOkNftn+yOWfCkIAANXL2/mj+XkjVnS0z7 DOcBNj7+PRA7yPtU37C3nQyaL86b4Qbn5aLrksFmBQiYIByQ0YIvmhGPYgHpvcP6ZhOg qBf+qjkc4ALLIat4pccS9isiC2mGA8S/6NApZZoU9bNqWjRqbx01kRPvGRLF5JvC6AZX C+FW4ET+/WDKBRORp53JReCaN9ALNdid9Q6bN7QPVZOy9bmjAiEpW9FcgzmukCXwll55 Op5jLP3MXIIfde05rqNSfu1rS8UCLap0OhHck1MZH50zjDbOXxgEWWJoJYblii7B/6F1 1gxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qoKV8usW5vpFoZSpVG8vjHvbCZY+ib36Ahb8Zg+4+n4=; b=W+GYGKS+YfFTeRDoE3k1CHh/0TmUaYev+/kGWRpaQ5KMOTiV8/IDXzY2Qoq3GkpcSo jCue/77cBUIMgOKZvXeXl+fwA6113YUAqmpvYK7PhGDU46DW9T8gjwRf+BxIhGZFYaY6 S7QT00OndB7M4aDnGC7jmQNSkI8Sqyv56QwkZVgqEPY/apx/2PSKEJi4220jyq9uzsou seoERobt4gbvgSbBTtWeiQOeIp72Y/Kh2DM/XnhY1mXbDtaP7DSMoFWck1msQCn1NmB9 +EtGHQixy69Ts0T2OWEmFXIzingDHlAanPuo80F5SdiBwq3VSQByofQm+9K/BV8SRokt +Rpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u16si9198928edi.310.2019.10.28.23.49.57; Mon, 28 Oct 2019 23:50:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732665AbfJ1UHr (ORCPT + 99 others); Mon, 28 Oct 2019 16:07:47 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43616 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731838AbfJ1UHM (ORCPT ); Mon, 28 Oct 2019 16:07:12 -0400 Received: by mail-pf1-f193.google.com with SMTP id 3so7635242pfb.10; Mon, 28 Oct 2019 13:07: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:in-reply-to :references:mime-version:content-transfer-encoding; bh=qoKV8usW5vpFoZSpVG8vjHvbCZY+ib36Ahb8Zg+4+n4=; b=sherXZtGsiNnQeqKaiXtQVs/zhkKKaMgfLmRF7eeLlK89wRXCKa8V6fSt2aESd/bPt gR3TGkq0ebSBMmfw/KUasR/xz4SpnmU/mXsXwTUbhi2IpZuF5He7tV3Xr1wNBtNdSuZS k0502Tht/nOkrGh9EI662H7ZdP8//aHoG1nIO7O6Ggn637Fe1/4dyvI7L0TxH4t+dCBQ Rz1gxyM2UkJYvpAAbwTOputM063VVW4lZXf/572aj8bWozmyLbDxejbM7cpZH4cVMXzr U2IHzbGqYl3ZugC1hnbgzE/ZdhZeg0dbjCcjZELZ1CBgcS1ssFNN0OI9MbxzC0ZZu47U Bi9Q== X-Gm-Message-State: APjAAAUsSvOJGynnVY9AbP7/mvzwEFtt/1SPSzpeVGbh9fc+SsgXAuae eTk55KVvZlK9p3RE4ooSFp0= X-Received: by 2002:a63:3104:: with SMTP id x4mr22314986pgx.135.1572293231022; Mon, 28 Oct 2019 13:07:11 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id p3sm11084218pgp.41.2019.10.28.13.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 13:07:10 -0700 (PDT) From: Bart Van Assche To: Peter Zijlstra Cc: Ingo Molnar , Thomas Gleixner , Christoph Hellwig , "Martin K . Petersen" , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Bart Van Assche , Mark Salter , Aurelien Jacquiot Subject: [PATCH 2/9] c6x: Include instead of duplicating it Date: Mon, 28 Oct 2019 13:06:53 -0700 Message-Id: <20191028200700.213753-3-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog In-Reply-To: <20191028200700.213753-1-bvanassche@acm.org> References: <20191028200700.213753-1-bvanassche@acm.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the generic __{get,put}_unaligned_[bl]e() definitions instead of duplicating these. Since a later patch will add more definitions into , this patch ensures that these definitions have to be added only once. See also commit a7f626c1948a ("C6X: headers"). See also commit 6510d41954dc ("kernel: Move arches to use common unaligned access"). Cc: Mark Salter Cc: Aurelien Jacquiot Signed-off-by: Bart Van Assche --- arch/c6x/include/asm/unaligned.h | 65 +------------------------------- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/arch/c6x/include/asm/unaligned.h b/arch/c6x/include/asm/unaligned.h index b56ba7110f5a..d628cc170564 100644 --- a/arch/c6x/include/asm/unaligned.h +++ b/arch/c6x/include/asm/unaligned.h @@ -10,6 +10,7 @@ #define _ASM_C6X_UNALIGNED_H #include +#include /* * The C64x+ can do unaligned word and dword accesses in hardware @@ -100,68 +101,4 @@ static inline void put_unaligned64(u64 val, const void *p) #endif -/* - * Cause a link-time error if we try an unaligned access other than - * 1,2,4 or 8 bytes long - */ -extern int __bad_unaligned_access_size(void); - -#define __get_unaligned_le(ptr) (typeof(*(ptr)))({ \ - sizeof(*(ptr)) == 1 ? *(ptr) : \ - (sizeof(*(ptr)) == 2 ? get_unaligned_le16((ptr)) : \ - (sizeof(*(ptr)) == 4 ? get_unaligned_le32((ptr)) : \ - (sizeof(*(ptr)) == 8 ? get_unaligned_le64((ptr)) : \ - __bad_unaligned_access_size()))); \ - }) - -#define __get_unaligned_be(ptr) (__force typeof(*(ptr)))({ \ - sizeof(*(ptr)) == 1 ? *(ptr) : \ - (sizeof(*(ptr)) == 2 ? get_unaligned_be16((ptr)) : \ - (sizeof(*(ptr)) == 4 ? get_unaligned_be32((ptr)) : \ - (sizeof(*(ptr)) == 8 ? get_unaligned_be64((ptr)) : \ - __bad_unaligned_access_size()))); \ - }) - -#define __put_unaligned_le(val, ptr) ({ \ - void *__gu_p = (ptr); \ - switch (sizeof(*(ptr))) { \ - case 1: \ - *(u8 *)__gu_p = (__force u8)(val); \ - break; \ - case 2: \ - put_unaligned_le16((__force u16)(val), __gu_p); \ - break; \ - case 4: \ - put_unaligned_le32((__force u32)(val), __gu_p); \ - break; \ - case 8: \ - put_unaligned_le64((__force u64)(val), __gu_p); \ - break; \ - default: \ - __bad_unaligned_access_size(); \ - break; \ - } \ - (void)0; }) - -#define __put_unaligned_be(val, ptr) ({ \ - void *__gu_p = (ptr); \ - switch (sizeof(*(ptr))) { \ - case 1: \ - *(u8 *)__gu_p = (__force u8)(val); \ - break; \ - case 2: \ - put_unaligned_be16((__force u16)(val), __gu_p); \ - break; \ - case 4: \ - put_unaligned_be32((__force u32)(val), __gu_p); \ - break; \ - case 8: \ - put_unaligned_be64((__force u64)(val), __gu_p); \ - break; \ - default: \ - __bad_unaligned_access_size(); \ - break; \ - } \ - (void)0; }) - #endif /* _ASM_C6X_UNALIGNED_H */ -- 2.24.0.rc0.303.g954a862665-goog