Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp208618iob; Mon, 2 May 2022 17:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO5mTF4QRLEhwxOZ12EzAUjuvY1BGeLERcCbm1qS+k9ZPlZES3BOSckcf3uJ37wUYwt9pt X-Received: by 2002:a17:90a:4813:b0:1c9:e5c3:5abf with SMTP id a19-20020a17090a481300b001c9e5c35abfmr1878608pjh.139.1651536936922; Mon, 02 May 2022 17:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651536936; cv=none; d=google.com; s=arc-20160816; b=k//VKjCg0/5ZBjjwK8bDhXKI+jiw+N7jeL08vfV4n8BEkFkut3dowqlvEP1L8L/U1u +lawaQthH16Nw9v8MgZ+MX7lZeIvsjYCHZ2QgzEs/niF1mCjxznZCCdwvxMtdiGSURpu fPTK/ehWB2RtkhFJDJCxQxKdDWko4VD3K9jE03lWn8sYfn46FNiHR4hw/Rcu1eMXUFVJ yw41P5PkjvA0TOD1qQjosnaUqEc2WVX8Af/U9xcYTOqakCV8gEEh0Spne+o4BYmwOx/f eLerfauadFNuaEPa5Us8kY6Z44nj9WdFzHkT9uE/M7T1nvagDZV3YyKDowhYzs0m0gNo XzRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qOvLsI8DsR3wAsL7OxZXgG8Gqknv2QJ4ujs7VnYREEU=; b=Gyr0tZ2R+Uomcmz4vPpfTuh4gUBzFHeDmsLInhGTDKfyqyVYehEdqCSlv/H8hKmy2r thuVBHP0weUvrhgjjoKhdMlU6EdiIe4bvGaPKuJTNCJoSrx6HdGXRg9CrKdkZNrzxlQp FoKoEJdyOARnnP5NBuuqfhaxeD3of5zQWkg/b8Kqso2fWP7u2wwPvenc09HezOS3EhKC oQfPOMY7J1is84T1MeNZKC0pOJJHHj0vfOauqiGY2ljAuH2k98xgHFtgOZUK8LgLXQDG YSkpYJlZ/Z3YMyLA54qVJVcmfIIBoLjbhLcUpiypzVLXlLxzXrKmXst8Iv8gVc3nbadf 2QSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Y8ghBxEq; 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=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r1-20020a6560c1000000b003ab92744f7fsi15440007pgv.405.2022.05.02.17.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:15:36 -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=@ibm.com header.s=pp1 header.b=Y8ghBxEq; 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=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5449114081; Mon, 2 May 2022 17:13:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376995AbiD2N7L (ORCPT + 99 others); Fri, 29 Apr 2022 09:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376682AbiD2N4r (ORCPT ); Fri, 29 Apr 2022 09:56:47 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6DCACEE18; Fri, 29 Apr 2022 06:52:00 -0700 (PDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23TCWlAO037926; Fri, 29 Apr 2022 13:51:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : mime-version; s=pp1; bh=qOvLsI8DsR3wAsL7OxZXgG8Gqknv2QJ4ujs7VnYREEU=; b=Y8ghBxEqc1zof2K3jC0OlzpJUnRZxK5ITd/xBeBSrrTymwIrXgFqPSeULDxUH/X/YucU GzZvno+onN+AjXmMcfhfLIwGmr3K7ZPQn7TjWQM9RU/z4ZZtt6p0ATTPpzfZifKluW23 l82XBtCJX2Y0lLW1w+E+DVa+/q3JjwXTJ6e0lBjFJO5N/Z+FrvABSt/wc1UlnF+foNNt QzMVgtlpiOmhJeC9Q6+xs3TmY57ptOQ8Q4SPIuhMyKODL6NVMln8l3br/gfBTnWnXvXp 3T+zj3JXt/YjMkGwj65FJy3sWyemL7mIzVpr0roKoYSX8oZQ2Jh0rI6iuyRnhQNwuYn5 Yg== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqvaq27d9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:53 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23TDQpx0021546; Fri, 29 Apr 2022 13:51:51 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 3fm93917rx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:50 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23TDpm4053805382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Apr 2022 13:51:48 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A2C7B4C044; Fri, 29 Apr 2022 13:51:48 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69B4B4C040; Fri, 29 Apr 2022 13:51:48 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 29 Apr 2022 13:51:48 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann Subject: [PATCH 37/37] asm-generic/io.h: drop inb() etc for HAS_IOPORT=n Date: Fri, 29 Apr 2022 15:51:05 +0200 Message-Id: <20220429135108.2781579-68-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220429135108.2781579-1-schnelle@linux.ibm.com> References: <20220429135108.2781579-1-schnelle@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NRUZ77sN03tBA0UbTeF2c0ZbodmftGFF X-Proofpoint-GUID: NRUZ77sN03tBA0UbTeF2c0ZbodmftGFF Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-29_06,2022-04-28_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 phishscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 priorityscore=1501 suspectscore=0 mlxscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204290078 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 With all subsystems and drivers either declaring their dependence on HAS_IOPORT or ifdeffing I/O port specific code sections we can finally make inb()/outb() and friends compile-time dependent on HAS_IOPORT as suggested by Linus in the linked mail. The main benefit of this is that on platforms such as s390 which have no meaningful way of implementing inb()/outb() their use without the proper HAS_IOPORT dependency will result in easy to catch and fix compile-time errors instead of compiling code that can never work. Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ Co-developed-by: Arnd Bergmann Signed-off-by: Niklas Schnelle --- include/asm-generic/io.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 7ce93aaf69f8..b2572b2eab07 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -448,6 +448,7 @@ static inline void writesq(volatile void __iomem *addr, const void *buffer, #define IO_SPACE_LIMIT 0xffff #endif +#ifdef CONFIG_HAS_IOPORT /* * {in,out}{b,w,l}() access little endian I/O. {in,out}{b,w,l}_p() can be * implemented on hardware that needs an additional delay for I/O accesses to @@ -522,9 +523,12 @@ static inline void _outl(u32 value, unsigned long addr) __io_paw(); } #endif +#endif /* CONFIG_HAS_IOPORT */ #include +#ifdef CONFIG_HAS_IOPORT + #ifndef inb #define inb _inb #endif @@ -703,6 +707,7 @@ static inline void outsl_p(unsigned long addr, const void *buffer, outsl(addr, buffer, count); } #endif +#endif /* CONFIG_HAS_IOPORT */ #ifndef CONFIG_GENERIC_IOMAP #ifndef ioread8 -- 2.32.0