From patchwork Sat Dec 5 19:17:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 11953415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B317C433FE for ; Sat, 5 Dec 2020 19:19:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C32AF23110 for ; Sat, 5 Dec 2020 19:19:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C32AF23110 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=prevas.dk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=05yCjTy6X+J+SpntGE2PLjlthCsn0tlofo04v+qpv/k=; b=BaZPQcPfpagcK/iG0J26iV5IB 6kmulWme7JFlOibNFBckKjbZYWI4T9sEn43uPCB0crMA5sVpH1xFDcPXxygM3IQ5Ur7lWKq2GF0Xm /YaNDiJvv0I1sIPI9qhS/cx1A6L5XgGc0eGfrn+7l2hsNm+e5tk8R5dda/5t45/x+j1C3vQHndlYi EQj4DuXQuNai2xloVndGwy8qIiRnJksr2hHrWjhDoLFgJFnX/hNSDIbuLH2A1xz55V2c8BdxMG5Fj eF6J1t1afaCkxy+1RKrrCXStrXgEJsE6gYoANs9oPWwvGWkPKSGNNdGMx84+qTwYqF+45pxkY/2j8 rKVDaXPdg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kld4d-00043k-An; Sat, 05 Dec 2020 19:18:27 +0000 Received: from mail-am6eur05on2132.outbound.protection.outlook.com ([40.107.22.132] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kld4Y-00042O-Hv for linux-arm-kernel@lists.infradead.org; Sat, 05 Dec 2020 19:18:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Py0RdWxu21rr5NbcRVJrRwt2BrqRlAa+V4prWoiTXL2I6heaKjE6E+0HDLPSYv8RpGEHJ3i8UdRmv8ZBkJ00nK5suFBeG6kW0G/OwcVcbK2S0ZipyZ2YN8NUyMIJTaXkaMwk/AtgnuqS+VgG1n5VkFO62ph+yj6yLru2H8YiDp49lnxcYkgR+xBzxBO4pcyRsgaC4SQugyX6SXfgeiURCpT7gLQ+LmkeJ9azGEJ9MVFllhg2i5LIkIpH1q0sm9OEDZxicYdpzzWumGihSg91f938Qrv5zGcljY+RYWi6KnHTvIkHygrEU9WpV+0iySjaTX9R40R6I7G9QCyKOZ3y/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L9pAQ+YkqD8NXspjdVpOzcZ8lBwEd3OxgZUpUgEUfGk=; b=RCqNTPpTt8/c7knjsBmzL0LgzxuWQbQiZjdNtDuQ51KVB1i7hfzlNgGW5LyIvSopuPQgO6u6Ej0Bogvn4QAXjh5MhXgbhV5159I9Dfl0XFLUx08eTTaeLkNOfjdkDMzhRn6bhiyNOzIYABr07vJx64Ij2lvl7XjELyK4hfAPhkMea25SXThsI1ZcSvqGHWqciwOp1LlGhJw91oylUqtkpMYVB82PhLAtrLrIrSjzf+nd3w3lrDIjHB2PBkZUKERT25rz43CipeQv5Z1PAhvVMwJfT3M3yy0CEFYvBN1cpRZZQbbN4+WHalNPeuRV9pHhhsXb/0V9TI3fMXP95BPSEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L9pAQ+YkqD8NXspjdVpOzcZ8lBwEd3OxgZUpUgEUfGk=; b=OcUUy2W3N22zLQV8ykKz68dNVC4zBJQbkpOYmj/YEAJVFqCpALBNkHXTKZWZzV3qzgkEXvzcsE3gbXOSs1XrZ0ldMbEq7ZCdpCsTFAoDG+cIxoteRoR3iS0bO0p4cN/VM8PYnH+q5dsNTJPb3v4IIXc1FWNi2x9Fyc2uRHn4NXc= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:20 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:20 +0000 From: Rasmus Villemoes To: Qiang Zhao , Li Yang Subject: [PATCH 04/20] soc: fsl: qe: make cpm_muram_offset take a const void* argument Date: Sat, 5 Dec 2020 20:17:27 +0100 Message-Id: <20201205191744.7847-5-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ac33b1c-c87a-495a-976c-08d8995286de X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aYQDumrQnT+OF5o9JB47+9HZQRBZfE0kXx4BucBXfm9ZT1ln/lhxa3R1wuaJ3qIhnd1nJYkQVv+icg1JK0abUSHT5/TLyXOaRCcY8EM8yG7FnwMHbEOosiK+fBir9jArk1ay4RujMFAiNIUHfD9/cu99ZHG5lqXbHymBk9bKQS/9F0ELBNVM23otukNgFUPXZJ5TuUTKZxhmy07C7RZkyIC2nEPEdTVDsgeI5c+uHzZdhcjRSMEoqOpUHxNJPHpIevlJHgSHsLeZ5UOyoSEXvjcrXGC3KmXH7d84osKuGP/34WcfANdE5N7omeRFLeu88WVz2FXlgJLRN51PTAhzzw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: a84jwIJNlLFA2sQTN5pqEAcPLSCkuM0eBjvlXZ9Uz7zYbEUF9EZ12SfmPzaZ9qqpAcUtRXBqlLtBVWA5Jm94H5sBxFNGabfAQtHIQLNdVLqecJPIccLQ//Ylv9PCsorImlayQnY4Y+EuTNVrbO557pWba4xV2wl5OdW+hClzlPzqGdPXkkmYhOfHZc/6bIHiFr2JsVLcGGI3XrjKp8Vh1ZGZXzcBk9ZyMkN1tItKUqj4T5XrfGsJW8qFPGGMWlmHtogQuzdUsxQOy3cyJ70uDjrPC72zpPj8q+4FovKpeR5h5UZo3wroIpNCARUfuhpPVjrO21TF9vEEnxIgeBCgJ2Dh3UcN2HlO1m9n0mt8q0XKCCNluanKtE+yEj6Rt8OAu1lV0EHFw3rxh+AWei7SVC4kE3BGa/AkK1Me7kqrVckLqgS6qBt3vWTnSJIfpSNvfdew/NGSUUlXEIIrCdZLD9X3NzsmjQktSbR4zU1UFmRdpET4oMYtPBUAeFxdPVLZosQWwiGK1gRoUdbCD73g1SM2wGwRS65yt2T0phQc+loJ3vKMfMj0J5o5H45aWwMdEeASgurANh9G1s+5uqVSMtnrOW7eLkA+9lmFFUvESRuzFN3fCLLRtuxJh9TseTf0XxovpH6taxLZ5tmTZzylKdM3+AOIVqQRwkoxzTkuiZMvW+CHeV5vh6IbAnuVXpLD7noT/phD3ueviylEK5W00Kb9Sh+xUdAQgW3qsMdy7hB7bRZHcvGvWar4wX76yadCFe9fQyrmhankpsqzhyNKOKfTh6kGT59Co+PNopjcGNdeJVoYhSoKotSAipmzXArAgEb1jEv9qTn2vhtTFkGWe/JGdIF/1yR58+ErlKJMZjZN7WRWsCAjwTp7W2+XuZrVOjdPuoV9KRBbuwu1CcKBN3GO+H6DCIihMqv+YdXHb2ahmxgxRAYEZfrFoWEzFyOimXVYb4wNppROAoetS1Bh/azfPEMcejiYzRUW7LPKZ/XXUidTRDXz+9lA5z477TAU X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 5ac33b1c-c87a-495a-976c-08d8995286de X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:20.3457 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tFOV25s5V8wGIlmsFgcgnE5fViDG5SXa8O8wI3MbkwaeJVpC5k2o5bEsC1kmlP5mykIW0v306lBL8Kra1H+gVsWtyO5rKlVBG4K1rTBeklw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_141822_712212_9E55840F X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Oltean , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rasmus Villemoes Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow passing const-qualified pointers without requiring a cast in the caller. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 2 +- include/soc/fsl/qe/qe.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c index 75075591f630..0fbdc965c4cb 100644 --- a/drivers/soc/fsl/qe/qe_common.c +++ b/drivers/soc/fsl/qe/qe_common.c @@ -223,7 +223,7 @@ void __iomem *cpm_muram_addr(unsigned long offset) } EXPORT_SYMBOL(cpm_muram_addr); -unsigned long cpm_muram_offset(void __iomem *addr) +unsigned long cpm_muram_offset(const void __iomem *addr) { return addr - (void __iomem *)muram_vbase; } diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h index 3feddfec9f87..8ee3747433c0 100644 --- a/include/soc/fsl/qe/qe.h +++ b/include/soc/fsl/qe/qe.h @@ -102,7 +102,7 @@ s32 cpm_muram_alloc(unsigned long size, unsigned long align); void cpm_muram_free(s32 offset); s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size); void __iomem *cpm_muram_addr(unsigned long offset); -unsigned long cpm_muram_offset(void __iomem *addr); +unsigned long cpm_muram_offset(const void __iomem *addr); dma_addr_t cpm_muram_dma(void __iomem *addr); #else static inline s32 cpm_muram_alloc(unsigned long size, @@ -126,7 +126,7 @@ static inline void __iomem *cpm_muram_addr(unsigned long offset) return NULL; } -static inline unsigned long cpm_muram_offset(void __iomem *addr) +static inline unsigned long cpm_muram_offset(const void __iomem *addr) { return -ENOSYS; } From patchwork Sat Dec 5 19:17:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 11953413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80BC3C4361A for ; Sat, 5 Dec 2020 19:19:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F5FB23110 for ; Sat, 5 Dec 2020 19:19:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F5FB23110 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=prevas.dk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=j8FjnyyFkEw07mXo83hyN/lKLl0cgyZvxJxEZEHCxMg=; b=rjcL/obQfhUkhIJWX3thY8py2 6zWHIVUXm3wgWsAxDPxiNVcvaKKLtwNVNKsHZy/I4xiQI3gHMeSEdVfdzGGfBeCg15fNhzTWbR619 Q0oerKHtq+UBDe49kM9JSZ8Bnd1jNRYnKbb/TXKGy4EUj7m6JMeSHu/EgQnSLflmIIpkrxtG3U2Kt Ms8jnorkjvbwuPyVbDIM7ZydMg1ScXDIe+xfL4+lBJt6HpbJPhGF7p7GFNDRTeTFZ/LeHNYzgAlQV TsSlNJxs0Tbad206P82gWH4OyiVuTaV2Mvy8HvWM2Qz5KzGEmDuh9Xk8rSGrgAktEcu5ff3KIpAs0 IjMBq6nPA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kld4g-00043z-32; Sat, 05 Dec 2020 19:18:30 +0000 Received: from mail-am6eur05on2132.outbound.protection.outlook.com ([40.107.22.132] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kld4Z-00042O-Rb for linux-arm-kernel@lists.infradead.org; Sat, 05 Dec 2020 19:18:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dVg/OPtMnqDfTgwEVDTlvHAgaV0ZAFDJNL/wDn4ttVBp1OzPwZzIC2JrR66KwqQEvjx88Sfjvzd6oSpmw78JAJwKHYJHDXSBBxi3kxlZr5TTA+AqPQjN2YP+MiQnPVHuRt3QjB8/Q8i2nMOo8itcyWmK2nx/U385Nljr6HZbValMq7nUclhRNop0CzOukYNjoKjz1CxD44Dxv6oZoMRZV23FSkXIxDlJqAQgBP7qwje8DW2S63cXtacflGfz5sQ324TuCLjheHI8IIVlt/u1pekj/DRjXwMxAhjLCHDaZsU/BN7agXRwe6jAulSa/6gSgHj+OOvXuBuuI9y426ml2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hD3p33cq2Q/qHWFYl7dyPaDVPwth76FWgEjkXuOOk2k=; b=E6kz3Zy19HuMOsUbCNhiJ94nLWtt8RdLdFSZrJCv0WteqWeKO1nelDaL1gFm8TItmPKeNVfWIz2jKJ32P62HG88ey/yfTpImvQe/Minp1+j4gMwa9rVfIPyH4/qU1999fgHyGMTynm4dgFZiuQqJbDYJZu39iLhv+oRowMsUtsF0LbarEeJmUFwDj+51esMHLgzKqvH7+rbT4Z5EUZ9xZiJI81R24bu+jTKrG/UMkvGt25Os6qPNZiJeepi91tqhC+koZQnYsiHDUNoL6Yy8KrLRzogfmIEKbcvfBE8p5SI3G8f00sCAuzJv7axNx8sTq4seMAZTyIXra0cdDGD5rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hD3p33cq2Q/qHWFYl7dyPaDVPwth76FWgEjkXuOOk2k=; b=HT8ffAt3Ay12LAz0u4GGleeMOyEmplnHZocGeL+7m6hRs5uF8mhFPpSnCN0yiPXQJN31VrVgEeWJ/xXcck9WJbZYG/nZf5/iFr+ec+UPHQgsHfP+cXHLo+FklsZVYU1jDhkkiJ5jgHpW5KBDxl4624sfhFN54ylWs3MjDY4G11g= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:21 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:21 +0000 From: Rasmus Villemoes To: Qiang Zhao , Li Yang Subject: [PATCH 05/20] soc: fsl: qe: store muram_vbase as a void pointer instead of u8 Date: Sat, 5 Dec 2020 20:17:28 +0100 Message-Id: <20201205191744.7847-6-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1121de58-b2c9-4ddf-8a30-08d89952875e X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7S+yvHFOXe8CLDzlH1DjO5GCwol/bLOxJqOPDeEV0FCZJdd2GsGFtH5EuAY8eqqqX2D5THRXVGGFycwTbrj+ZUpg7vM5FImB3b8HGL6VIakl9QTetDlSD48IjFTLAUTuI5XtEGaKZv82ACqQwGpzc6gWthvdoLRz6F+A4T5pGSoPvOYiDos3Wnz62YqnZWIDwbxXMa2mNsitBD4Y/IV1zPd8bH9UQ8+2SRuSDRLS74WeQApeDW8hCPg7COdSnJYcCVDdxGO2kBtomg+39262vYLQnNXzRjIKkda1aW7M6nrmmDFEYbFdj9WM/GUQvTkvzONdtgTRkvU2gHeqGCQKnw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: FQ4P38eHL60L3b62IsOr2JpT1fMjnyvNBjzKSa2CObinkIywVXPJaGI7+5rygkNjkxPxyQlUFzRF/PZiKsiAoC5IMf8bC4DW2QaCrB6JuWnfcBzPnZ2T4pXYDWaDjFSE+n1KxmmkgAeCK4Xape4zZU2n5ahjWeTHLpcQJggxvGK+luQuFzVY0+IKz8u0HFF3GSpwQKYTgYmsGpRL/4Ww6B+Vzl6OO2n26mt/w4Xr694nGc4cBxKLGmkyIsa3NgO8529GpOG3SzgJkgCH/RpdeSJcnj4iX9wdS4FMoeLd/qNFsDocRId8gId1lVc46g5xlfVp2FGD8EWHtF2X6EJ4UBPVbJYyrDsmmoi5bN9aEMiOwjRavSCJzgzTD+F+V+5/7oKBmnKm2TUjz+EhuE3mgu1huIO1KI2jFA+ehRJzJ+D73JgIfRLVRORbiC2YgmB+4jzJ9iXu7q0olwSu9pcEIAGVgzgI/euDjfp1Pb/jicI/ATZGYUGmFiUgFcLnp7QgHfQDDC+6KmJrRQnQacknJws9sVsNmlV22NUoR/j1FKhEdF/k6lq4YeekMOqus/vAsN78HIcA36ywwRhwsUAsUEK5atHvC2j7JNz6Pvwx/1kNYVEReJPbobzBHUgjN/i5MaoYcrNxKepSqxhE4YodzLyY6YL81AhkWuXXGWmHR8CU3nnP2URqdGsIjYnFmelA0cxvpbDBSPqoP0GevzU0+BO0NV6LRuTSViMR9WKq6dkuSd/89HGHS7RUDzrrCmkMFCfhNXDttu1ND/uIpwEqO4VktfM4VTdIyhBqIDLOuIEVgDzRogQL1J2CBxPThjxGiGtkA0+LQ6CMf8yDbbz9vFUCChnsV9gMwanHack9kndNUriHll1fU1hkCAIsieCNZyo272JdkVzHAc1zUYxkr22HMItfgZQfnbYYuRUm9A4/H3uwFAuCU4FXl3q4PtO1u/kaxBTk3q2UuyVSvUiHdYKSGwp6AUH9X3yz9+sZXnXedx5WvbPPlkRdwdzF4i9K X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 1121de58-b2c9-4ddf-8a30-08d89952875e X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:21.1882 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ka26JN6H28u3Vkn41HV63GNA0YjSP3uoijgPSUNjHFugy+4cOyVStpdWP0qLE+sqtqd/liTtGnAp4gyMq+gv89b8cIfVhBZmZZ4AJHvFKOg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_141823_900775_ED98434A X-CRM114-Status: UNSURE ( 9.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Oltean , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rasmus Villemoes Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The two functions cpm_muram_offset() and cpm_muram_dma() both need a cast currently, one casts muram_vbase to do the pointer arithmetic on void pointers, the other casts the the passed-in address u8*. It's simpler and more consistent to just always use void* and drop all the casting. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c index 0fbdc965c4cb..303cc2f5eb4a 100644 --- a/drivers/soc/fsl/qe/qe_common.c +++ b/drivers/soc/fsl/qe/qe_common.c @@ -27,7 +27,7 @@ static struct gen_pool *muram_pool; static spinlock_t cpm_muram_lock; -static u8 __iomem *muram_vbase; +static void __iomem *muram_vbase; static phys_addr_t muram_pbase; struct muram_block { @@ -225,7 +225,7 @@ EXPORT_SYMBOL(cpm_muram_addr); unsigned long cpm_muram_offset(const void __iomem *addr) { - return addr - (void __iomem *)muram_vbase; + return addr - muram_vbase; } EXPORT_SYMBOL(cpm_muram_offset); @@ -235,6 +235,6 @@ EXPORT_SYMBOL(cpm_muram_offset); */ dma_addr_t cpm_muram_dma(void __iomem *addr) { - return muram_pbase + ((u8 __iomem *)addr - muram_vbase); + return muram_pbase + (addr - muram_vbase); } EXPORT_SYMBOL(cpm_muram_dma); From patchwork Sat Dec 5 19:17:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 11953411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 935C6C433FE for ; Sat, 5 Dec 2020 19:19:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FD2E23110 for ; Sat, 5 Dec 2020 19:19:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FD2E23110 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=prevas.dk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=viN4wt3dd6jARkDUSg00fVk6J61yUhYGS72aZ8ftqPc=; b=KoV5dnlAoqUb04YaVn+RyBO9t +7LEwA3YRAYOsBefA9ocSuJV4fZ2XBLa5kZwjBGn+6uAB0rrR+orWb1BaDjAXGu3wuti1tnuir7dq 76+LvM9/4byeKySIpH36FAYRQVfZhO7iEpwLTR/JE6mr6W/5Ep+6QGOR2Gua9BMIMvC1XM4w7iQyc 1xancN204/iLxgBldJhfPTWNPbU3NgjeSO7k0trkwAVnrTZ0y86z6kPRURIr0HDTB/rH4jAAcdFYW 2i6ZFe6R0LkJBN/VuWPYwSrSF3ejCiUswORcaRSuMTAh3tG17Yke6+pV607URyEoHwDt7J/vTDdYW 8LC6NMUfA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kld4h-00044H-TN; Sat, 05 Dec 2020 19:18:31 +0000 Received: from mail-am6eur05on2132.outbound.protection.outlook.com ([40.107.22.132] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kld4a-00042O-SL for linux-arm-kernel@lists.infradead.org; Sat, 05 Dec 2020 19:18:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e1pBv1/Je+UeSjJD6JemeRUbBnfsVd/w0nQqTS2f97GIvT721jMKIWePja0SO5+0Cs8DnabMHTWmeMuuWDgFfQcliYJhG4UxfxCkt5bu9y8VGIYWexym5GXkMwy4GIuh0Ed5oc3VhT8sK+YN6qo/SzOhy0JRyvdy3uGMdPZibMXKI2XxAqzNRj0G7WBoQcGc9KRGRQBOqOUogKhCk2SORweUHTEfBsJQkc9+gxrjnLkU48LzB+S2uWb/84pR+Ig7V2u1y5gnRsmIJq/DWx/07lwAvS1Hzi46JVoTpWq7CET5xp4FY2auDEHp5Lv9KsyFHbAfC6OZj5cpke+8xck7oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nbeuYQ5z0yv0bqY63C91Xkj2WIbCJKoREPOQvXArM50=; b=YLhJwxjc6u9nkloj1WogjmNfPc/fPl/tRFsHsG88UW3hdUXz631bkdE/nuTTL0cJAaQXteA967D6kLO4ghW6F544S6DS800lsBNHD8Q+gx9A2SFDxhw8gXX8ndadi65ZqbxvhqzMZoKAGNBsZ58DzCAe/OHmOH/RD+rWHgFRozOmmo26T/cGokrVevk2Ta2+Hi6MxvfPscBWaybQ8Zg4qh2dkWIxVLbZsJxBjuV+2UzFdLeEyr7R1tJMpg39mIAEewioCcPQOdsTH7iPvI3L5xIMXYqzDmAGv3F+53mtr5OU3d4s5/KBewOyi/HAlhlRkvRkkSWAKvrrEDDR+aY8QQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nbeuYQ5z0yv0bqY63C91Xkj2WIbCJKoREPOQvXArM50=; b=j1M7cxF6A/OcmRRsmR0n/11lJUQQuNE4Jd095L0qdEMc9Cpakh+X4sel28ye/vjYXnNGA9zS0Sc6I0YXXtguU1nTjwoxoW5yEDIcvCh/Z6VWzbD2+0ZCaO40I5ib5qfjxnaDI6ZeFW2U4lBhYrXWgXPCtMqFNWY9fJraHIetvGI= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:22 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:22 +0000 From: Rasmus Villemoes To: Qiang Zhao , Li Yang Subject: [PATCH 06/20] soc: fsl: qe: add cpm_muram_free_addr() helper Date: Sat, 5 Dec 2020 20:17:29 +0100 Message-Id: <20201205191744.7847-7-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6012a865-70f2-4f38-635c-08d8995287d8 X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NNuj/RlT3jp7WI22eCyms92qPqR7Kb5imhdsBqPkO6OGXdMFzw3OcWRf4BqAZakEfKzd7SiC6TxAs+btcoICs+hRQbLKeyDFoNSfpArVm4jSZsodmT6IKsi3Tg3qVrUCUFTGv72uRMNNEHCJS54/FtGar+e0O48KA71tIFmuO3B+QwDqNrfo9d23ki2PhXGXIaow3UjnDuJZzJRhwrqOSaSB8M47Sb6/kPTOREM6DH2XkEkutlneRup29+6XGMO9FAJR//PVtFN6DJ6wj7cwAwJjK+SKv9xxAqUzrWNDkFuSxchAYA5i/VS/l98zm1u7dyeeR0aiW4zBtdC6D29zlw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: bSclpNEkcYOXhHSIAqOtV3AArJXSfsvKPHUBlj4tgEe3rliFNXL3y7FHN6kqmxA/zg6XY9yc0NPOPF9a7PxC+EqX1ZP3Sqnc6VEYaSDhZb6LW8l1hjwv7oyeLO+kfOQ03XZvBDYdvLLdTQoH1w26DDmh9OLyFUCPyMGmEzcXAlTQxwYXGfOB0WuGOHIm2HbQspvhcW/6p2UwKZGmk/UpKfVmfmWGu1Ydb3BUvSmqo19Yaz8ab3OnuD90wiQlmUmuLObKos10y/lnTYJHv+bYnqbcZSg3ClM46vyCV+BEDCIfE62NYSwl0oAdNhtBUMvkqtu0WRIYD0uu1RQF9VvSDZGy5D5KV96Y6dq67xrkLT62yZ3Gj4RTD2Nx2kMHwBMi3VH9TXVNT/y5GTs4eJI3bga3uFjNMk0Z1+1LJQjc7TUT3PUsws9zlthWXyNouEC2UQ9dYQEyk36n6S8IGnsXaZATUTWwGr7wkuNRRmj5pAZqZwAhzJGbKtrDsLdIAlA7/Uv/Xm3F6nHbUSWmTcb2LdGG1tjaIK3LsmEhGjx7zCvtt2VQFaJcIf8ax0sZuBpPy/zfPDcqodZfjWIsHolDrbpjw1wR2SXwhAp/QxW+QJr5CGnPa77qawW9js394/H3MSzuDVTlte6SdAA/1QNX6A1eGrAeTTDP6ovM5MUjQyWjHIL2HAZ+MlmdTKFzyEssmcOZKzfdwjdSncky/uNYECU7w2a3mVi74RcD5zAczhgNnZF79CElwuqE78/7n2LSUPuXaS4iocN9q7RLYERpeP2g7+uU6RXvu+K3pa2gFW5oMc+uIOgt/beKhCd3cP1tg0Nz0tsycO2nIlEnXwzhj4IoTLTKKSmogMHy5iTyBzK40UXWOWQLZ3o5h8iiZoVAp3+kpWddAwhI1lDrswxqoMYUfX2fNnzVkT1Xswr2YCUQAOw1DhJ8iNiZt938RaJUA8fEwn5wlZMfI1FW3cdujekOfJFODDrIbpyHCp7LzmQ3xJCWngcxTYprEewq7Q/g X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 6012a865-70f2-4f38-635c-08d8995287d8 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:22.0437 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jFOW1GGhUi3LbVEg4FgTaP9gELyQMqvGeDBGGDilHQukeptGGT9Y/Ld7XgJ5H0iPq8puypekc6mgIU8SasK2dp0XHVp3yaPn9nl5FNItG4Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_141825_024241_188437C4 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Oltean , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rasmus Villemoes Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a helper that takes a virtual address rather than the muram offset. This will be used in a couple of places to avoid having to store both the offset and the virtual address, as well as removing NULL checks from the callers. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 12 ++++++++++++ include/soc/fsl/qe/qe.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c index 303cc2f5eb4a..448ef7f5321a 100644 --- a/drivers/soc/fsl/qe/qe_common.c +++ b/drivers/soc/fsl/qe/qe_common.c @@ -238,3 +238,15 @@ dma_addr_t cpm_muram_dma(void __iomem *addr) return muram_pbase + (addr - muram_vbase); } EXPORT_SYMBOL(cpm_muram_dma); + +/* + * As cpm_muram_free, but takes the virtual address rather than the + * muram offset. + */ +void cpm_muram_free_addr(const void __iomem *addr) +{ + if (!addr) + return; + cpm_muram_free(cpm_muram_offset(addr)); +} +EXPORT_SYMBOL(cpm_muram_free_addr); diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h index 8ee3747433c0..66f1afc393d1 100644 --- a/include/soc/fsl/qe/qe.h +++ b/include/soc/fsl/qe/qe.h @@ -104,6 +104,7 @@ s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size); void __iomem *cpm_muram_addr(unsigned long offset); unsigned long cpm_muram_offset(const void __iomem *addr); dma_addr_t cpm_muram_dma(void __iomem *addr); +void cpm_muram_free_addr(const void __iomem *addr); #else static inline s32 cpm_muram_alloc(unsigned long size, unsigned long align) @@ -135,6 +136,9 @@ static inline dma_addr_t cpm_muram_dma(void __iomem *addr) { return 0; } +static inline void cpm_muram_free_addr(const void __iomem *addr) +{ +} #endif /* defined(CONFIG_CPM) || defined(CONFIG_QUICC_ENGINE) */ /* QE PIO */ @@ -239,6 +243,7 @@ static inline int qe_alive_during_sleep(void) #define qe_muram_addr cpm_muram_addr #define qe_muram_offset cpm_muram_offset #define qe_muram_dma cpm_muram_dma +#define qe_muram_free_addr cpm_muram_free_addr #ifdef CONFIG_PPC32 #define qe_iowrite8(val, addr) out_8(addr, val)