From patchwork Thu Aug 10 07:40:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp259383vqi; Thu, 10 Aug 2023 01:05:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvSChnIZ2H4mlDm7KNF6krDeUqK51PwP/i29vTXgxA/FcGTtp9bRF1+iEdOTwRC5OME5xq X-Received: by 2002:a2e:6e0f:0:b0:2b6:eb5a:6504 with SMTP id j15-20020a2e6e0f000000b002b6eb5a6504mr1425634ljc.18.1691654730960; Thu, 10 Aug 2023 01:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691654730; cv=none; d=google.com; s=arc-20160816; b=TqrtDY1ruMj5UcpknVsF04TI7Gq38cSkhh7LZTC1hvwRfrNEpUU58mIStkPja+aaA7 IVCKrIuBqoxnfi5zN2AfdMyQ3mzwDBHvJgp4aajbLM09gjlkVQ+5oS4ux+kHJoBpy2fN 5qzXka9DZkSlKNz8ro8ja0i95FGNrh4pyoVcalscEGw+go2Pq6sgZuN34uPi82A8H9Ax PX492QpHugbikHLL/2AvNUPJwXZwJywld8iMUZeRL0+iuMl9vlOKIE0uZglZQp3hR0Wx NyEDknbMftjWuSWTlx49x4vhIzVNPWLG+e5ijkGHeo7Y9XfpT4IenZ6OfqXpA6DbrjC+ jH4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=JofiBfwzy3kjUFhKUXLWtoVye53MuyuBLLBCjo+WoM4=; fh=U9aMXhC4C3vp50RpX5/W/je1e0oxyhy5HPsCZC8XORg=; b=MtJvM9VILVdLkJoFWfA2ummHUeXtnrSlD+VBlL+UWT7x7jsQ4/L/JYk+ecH6RVTFIy hKc2Ya3Ys94LaAHE1IKbJ1nyq8NB6QJ7QiEHUQKuAVkMH5QtCXjuI0gnCdb8FyXcpfu/ 8XE4SSpzV0IbG3Yey5H82OGDuZ+8Zix0OHJicK4KsMt7Tff5X6La3/vlKkcx/ldP0M5F r/KTqAiV9OzK6pVjWRbpy29desO4AxmNPmKazklcMhncARS9GT8HkSESXT8tDddGzR/J GRN7yQypKur7rxDT22mI/bFsqaIV/Aq/GY6Z9lOdgLIrdFaTA9hKDTe3WIyC+ZfppBOg HUxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVft4joy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt2-20020a170906dfc200b009888bb065eesi1069329ejc.60.2023.08.10.01.05.06; Thu, 10 Aug 2023 01:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVft4joy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233903AbjHJHkx (ORCPT + 99 others); Thu, 10 Aug 2023 03:40:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233943AbjHJHko (ORCPT ); Thu, 10 Aug 2023 03:40:44 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE1512680 for ; Thu, 10 Aug 2023 00:40:32 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b9cbaee7a9so9335191fa.0 for ; Thu, 10 Aug 2023 00:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691653231; x=1692258031; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=JofiBfwzy3kjUFhKUXLWtoVye53MuyuBLLBCjo+WoM4=; b=hVft4joyMLn4SOCV/gtcK0uGplfoX/ab/N0cUYfJMXp0BuUvhnB+C7Es+DxTERT8YM sTab+94QLh4XkVOPFt9+WZcH3GSTvaafD/UTR/XdqyXdp7ouQMxcdlMxafmNE7yC+veY eYZjZ495+Ebk7od3VMGnHXe0V99K1WAGHKBKYYxDGsoBx2QpHVyN5XoUQo07xv7CfN4F z1AA0a947XMRdz+iXTM2I2W6J4sop9DIEI0mhpAA8qRXWz7/qd7GceCKzn0o33K1f9pW qYFzHuvTXx9dChjEZyHpAJTcRidkPDl5tnY+TEWjo5vsSI8eZExn3/tjNjXYPUP7StVS TPYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691653231; x=1692258031; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JofiBfwzy3kjUFhKUXLWtoVye53MuyuBLLBCjo+WoM4=; b=DFvItBHbyzsudtuTkBS+4f7avVuMtZhTZhEeT6pWDPgjoR9bK33AFQGRM8PtUS+TZY QZQayFnC5vfnqqkATUQgaREReThQI6FSuReqqERHaC/6GMSsAH6YThuYSM2+EnMZCwI5 vMcKsnzGE+sxA1r8KZZlwac+2yCrnkISvpAmtIUiajbx6eOdegB+xjwimdIL/CW3ne+z keQ78K3PCUJKVO48KjmKN/glVCnIzOlAJ8XtaTcWM4Iuqmn9XEKBo+WbZAhHBrtSkTBK 8g326wDRP0geNBLkUQgYpJ7fdY6jljwYd/o0WoJYWMajrom3sodvBJrq67ckqD4e/R/6 n3mg== X-Gm-Message-State: AOJu0YwWMZHMZ+RzQxqeDv1JHXFNJVun9cvrybI1WPR/hintso+z1Ute r8pludhq0NGyB0+9tJoKR6MKWw== X-Received: by 2002:a2e:9b16:0:b0:2b6:9afe:191c with SMTP id u22-20020a2e9b16000000b002b69afe191cmr1386270lji.7.1691653231072; Thu, 10 Aug 2023 00:40:31 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id e4-20020a2e9844000000b002b9ff8450aesm234500ljj.91.2023.08.10.00.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 00:40:30 -0700 (PDT) From: Linus Walleij Subject: [PATCH v3 0/2] csky: Convert memory accessors to static inlines Date: Thu, 10 Aug 2023 09:40:29 +0200 Message-Id: <20230810-csky-virt-to-phys-v3-0-f443cd2fc050@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAG2U1GQC/33NQQrDIBCF4asE152iI0TtqvcoXQSjydASg4o0h Ny9JqsWSpf/g/lmZclFcoldmpVFVyhRmGrIU8Ps2E2DA+prM+QoueYabHosUChmyAHmcUkge82 tUCiEN6zezdF5eh3m7V57pJRDXI4XRezrP60I4NBZhcrr3nn01ydNXQznEAe2cwU/CfOLwEpga 5Q10rfcfhPbtr0BEUIZXPYAAAA= To: Vineet Gupta , Guo Ren Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773828551323932774 X-GMAIL-MSGID: 1773828551323932774 This converts the virt_to_pfn and pfn_to_virt macros into static inlines so we get proper type checking on the pointers passed in. Signed-off-by: Linus Walleij --- Changes in v3: - Do not return const void * from pfn_to_virt(), return void * so we don't case a mess. - Link to v2: https://lore.kernel.org/r/20230809-csky-virt-to-phys-v2-0-2697c93f60cf@linaro.org Changes in v2: - Fix compilation error on pfn_to_virt() by more casting. - Return const void * rather than just void * from pfn_to_virt() - Link to v1: https://lore.kernel.org/r/20230808-csky-virt-to-phys-v1-0-ac727f8def2f@linaro.org --- Linus Walleij (2): csky: Cast argument to virt_to_pfn() to (void *) csky: Make pfn accessors static inlines arch/arc/include/asm/page.h | 2 +- arch/csky/include/asm/page.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) --- base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 change-id: 20230808-csky-virt-to-phys-3d80c17211f9 Best regards,