Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp193515iob; Mon, 2 May 2022 16:50:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwJO2Nv55ms0ncnF6Yn5rzi7mUHDamK2HAYQzbf+bACSOQAQgi5TjPcMuYayDWntWIBIv1 X-Received: by 2002:a17:903:11c7:b0:151:7290:ccc with SMTP id q7-20020a17090311c700b0015172900cccmr14456198plh.95.1651535446453; Mon, 02 May 2022 16:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651535446; cv=none; d=google.com; s=arc-20160816; b=sihEIWElA0e7XHx4ejLLG64HMwAIbmKK0YhK9iQhF2uaM/RtIcdV1GY+3TYDG2gVPk 3l1lQbqHgLLLMM0GCq5MDUFGkr6iDSJ2ryCleI4/m1+wl5OPswKt4phsSCaoBGgHDnKC 04kAb06NbD4ZzFI0yvPwAxIe7hfpxIHF3uAaLRjHvnna/oyOADBNqqH66iRk/nTXL+89 QQ+dqs6aAIFI/rYUWcxLDBTLQpg9+VuVDHuVfBaYfXB+IXAFX+lfU3pknp/qcNy62Dxe Q04MXoeYgrl/uNvStQVrmKUlnJCBs8rygS2KJcn4uCnT4PpqfzxWgxFqaZpqBeEX9c5u BIag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=7/OT12bMaVJ8TZ8rwZER5jmYmgYuDxOm3+8lCfUkhW8=; b=cEwrGvGS3iMES02G/IWA4e4dPe5jlscau4KO4/FILenbyKFmqKQv13z+2hTiquK9It LeylBXLM84lGD+ixqZPT2QJ4iQtWrzKCrMo2FBHlOmcVOvtW1E4wz0iUHejNeR9JDaE3 Iab36AnCSRzwi0HaMzPUXUq2z+4ftqTKkQPH/IAzDGS/72U0Jhtnoe4Ao2BwCI81tOu5 eyTflzZLPFdAEZhGlv5yT+I2me3oBtWYd43ZtQOpJ9dZhapX/dHOG+M22Q930coYe1kM 9yq1stH7tTcsmPPxLqGFI+KKB9basq+64RCf22PocMb/sQeTAG2jz5qNaF9yHP6YtMte YGXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=A8g2YPoR; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e18-20020a17090301d200b0015a16b86c56si1650255plh.81.2022.05.02.16.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:50:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=A8g2YPoR; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D32DB1CE; Mon, 2 May 2022 16:50:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376265AbiD2NoE (ORCPT + 99 others); Fri, 29 Apr 2022 09:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349047AbiD2NoD (ORCPT ); Fri, 29 Apr 2022 09:44:03 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96EFFDEC5 for ; Fri, 29 Apr 2022 06:40:45 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EE0BE1F893; Fri, 29 Apr 2022 13:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1651239643; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=7/OT12bMaVJ8TZ8rwZER5jmYmgYuDxOm3+8lCfUkhW8=; b=A8g2YPoRJ/CgXxC35/JX2XekZo1hSpp7MDNVfUJsLJEhX8CzSIDPet5XicETkLYXWyU3qN h/CEA2Wy9fDA//7/vuSIZQhpbbiSbNrirL31Vt2qTjtWIGQijif18izawcgYC4DfZqUoH2 1LtJJ0I8/kuBE4lOp1gb0XrhUzKeO38= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1651239643; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=7/OT12bMaVJ8TZ8rwZER5jmYmgYuDxOm3+8lCfUkhW8=; b=a2+Ca1QE0+BJ+0sViBO/4cTXWciUIi1Ht7BSd525Kz4Td9BtigdLzMfV45waX4SVA6h0JG 8TR8+HOj/cMFj7BA== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) by relay2.suse.de (Postfix) with ESMTP id 7C4C92C141; Fri, 29 Apr 2022 13:40:43 +0000 (UTC) From: Michal Suchanek To: nvdimm@lists.linux.dev Cc: Michal Suchanek , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , Zou Wei , Bjorn Helgaas , linux-kernel@vger.kernel.org Subject: [PATCH] testing: nvdimm: iomap: make __nfit_test_ioremap a macro Date: Fri, 29 Apr 2022 15:40:39 +0200 Message-Id: <20220429134039.18252-1-msuchanek@suse.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The ioremap passed as argument to __nfit_test_ioremap can be a macro so it cannot be passed as function argument. Make __nfit_test_ioremap into a macro so that ioremap can be passed as untyped macro argument. Signed-off-by: Michal Suchanek --- tools/testing/nvdimm/test/iomap.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c index b752ce47ead3..ea956082e6a4 100644 --- a/tools/testing/nvdimm/test/iomap.c +++ b/tools/testing/nvdimm/test/iomap.c @@ -62,16 +62,14 @@ struct nfit_test_resource *get_nfit_res(resource_size_t resource) } EXPORT_SYMBOL(get_nfit_res); -static void __iomem *__nfit_test_ioremap(resource_size_t offset, unsigned long size, - void __iomem *(*fallback_fn)(resource_size_t, unsigned long)) -{ - struct nfit_test_resource *nfit_res = get_nfit_res(offset); - - if (nfit_res) - return (void __iomem *) nfit_res->buf + offset - - nfit_res->res.start; - return fallback_fn(offset, size); -} +#define __nfit_test_ioremap(offset, size, fallback_fn) ({ \ + struct nfit_test_resource *nfit_res = get_nfit_res(offset); \ + nfit_res ? \ + (void __iomem *) nfit_res->buf + (offset) \ + - nfit_res->res.start \ + : \ + fallback_fn((offset), (size)) ; \ +}) void __iomem *__wrap_devm_ioremap(struct device *dev, resource_size_t offset, unsigned long size) -- 2.34.1