Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp485882rwd; Tue, 16 May 2023 04:03:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5fsGoq+nE0fkr1C26p5ASxeIVYu4vcOhbdzv09sur0gd6T+VwFuBzBL9Xb2vk9wwn30z7V X-Received: by 2002:a17:90b:797:b0:23f:9445:318e with SMTP id l23-20020a17090b079700b0023f9445318emr43367762pjz.3.1684235001200; Tue, 16 May 2023 04:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684235001; cv=none; d=google.com; s=arc-20160816; b=hxyvQGQRtzZog2kWLYkLnVI2soGfBKGuT/R9L0C76nWPxi6SOOsOPtc/5dhBbYWRFs P56JnO+Zuw159itspsJsdmg1Fe3mUQ/K0XNJ2qqozRBm2sOUCPWsn3UyQu/oBoiT03Nq VwXTiy8WI8z6LmRc6mYV3nvKYNm5jStPHD/t5EXIBRuHkyOA5BiEchdtL6eXjegIMgnK n3KqEdYmHxsgCJRzitBHzTesBG+BZpiGbTXh3GoUbDViOxwO0iOPIqLdI4wXGmu7ZWex svq8oxsOmv4HVLv+KBI/Lsc4aKB5yS9HMXg8kkKhdsSWIkCHFAJE6SUkZDjpLyu3qSej joXA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H89fhnXiQ7yFeZwgTqLm7B1dVjpm1+uYzA9HRVutYTQ=; b=VELEO+0d6kq+RiLCajZhH6zvRdSbmBFUrM5ftpweiJ7Ey6owWVGvR/j8ujUD7rRfxD laSfVi2QKG0MpSbxSCLp9xQjLfC2mKLXhN1eJu3e9ut9wMeNEfxTMvgL6fvrsXdEc7aZ +wPBO0oKFMpE9KZDL7eEtri7ll/ITVlP/giZW1sev0tlDKU4p5PMu45f79kXZ8Knvy+3 kkd8zRh2Pp3RRTdTNdRlsFbNKTGMdXf9D0dX5DTgX3rvht9INubwmlGzqBnoK7xjXsPM bHhG9UfyZHbgk9sxFq30ma7X/Om7/G81MXPud1B458G4xLYb1Gk2zH+aHEluPNP6wKfA dHag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gOMMOgd9; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a637e0f000000b00528baa26739si14389926pgc.336.2023.05.16.04.03.07; Tue, 16 May 2023 04:03:21 -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=@ibm.com header.s=pp1 header.b=gOMMOgd9; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232544AbjEPLBT (ORCPT + 99 others); Tue, 16 May 2023 07:01:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbjEPLBG (ORCPT ); Tue, 16 May 2023 07:01:06 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1FD23589; Tue, 16 May 2023 04:01:04 -0700 (PDT) Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GAdYlr024962; Tue, 16 May 2023 11:00:50 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 : mime-version : content-transfer-encoding; s=pp1; bh=H89fhnXiQ7yFeZwgTqLm7B1dVjpm1+uYzA9HRVutYTQ=; b=gOMMOgd9BKtFbM8/FWmoJM1Scwl7Mta83d5IWpx1J38IVxjryjX+RgB3sW6jwfIgtOYM 0aDazh92XKKkGIRF/DHeEa9fEo2Ui257NC5migU++J2YdI0sQT/H0pmRYi1nU2obDspU wJuHSGSpifeb8y7Nh5pahKA7a6EUSq2wull3UBSkonKqFXUOVc3/KPeeZ8alj7rEGPT2 D8+eZpph8Qkxi4CeFETxmLhs3iQulMo9q9X+M5OrJf/4KO8CFD+0M4JvtyDMx07DKCYq 5w/liqm974toi2TgPweN0EzxQA5i9bRIu7S0Dv4SzjQuBDF8Rvl8KPzZzOCGFERBE0KH Cg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm7xj12eq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:50 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34GAgi70007853; Tue, 16 May 2023 11:00:49 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm7xj12d3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:49 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34G5LLcY028625; Tue, 16 May 2023 11:00:47 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3qj264sk8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:46 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34GB0iSh39846302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 May 2023 11:00:44 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A19420040; Tue, 16 May 2023 11:00:44 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A9BC2004B; Tue, 16 May 2023 11:00:44 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 16 May 2023 11:00:44 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann , Greg Kroah-Hartman Cc: Bjorn Helgaas , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Mauro Carvalho Chehab , Alan Stern , "Rafael J. Wysocki" , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann Subject: [PATCH v4 06/41] /dev/port: don't compile file operations without CONFIG_DEVPORT Date: Tue, 16 May 2023 13:00:02 +0200 Message-Id: <20230516110038.2413224-7-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516110038.2413224-1-schnelle@linux.ibm.com> References: <20230516110038.2413224-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: -ufdyq4q1ulugnhNJTDv5u3VHQlUJIlL X-Proofpoint-ORIG-GUID: NnKsLe9KHoXoRX3q5rSOWHFkQseRJ-FU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-16_04,2023-05-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 suspectscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305160089 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 In the future inb() and friends will not be available when compiling with CONFIG_HAS_IOPORT=n so we must only try to access them here if CONFIG_DEVPORT is set which depends on HAS_IOPORT. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle --- Note: The HAS_IOPORT Kconfig option was added in v6.4-rc1 so per-subsystem patches may be applied independently drivers/char/mem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index f494d31f2b98..e0c3a1b89b20 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -402,6 +402,7 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma) return 0; } +#ifdef CONFIG_DEVPORT static ssize_t read_port(struct file *file, char __user *buf, size_t count, loff_t *ppos) { @@ -443,6 +444,7 @@ static ssize_t write_port(struct file *file, const char __user *buf, *ppos = i; return tmp-buf; } +#endif static ssize_t read_null(struct file *file, char __user *buf, size_t count, loff_t *ppos) @@ -671,12 +673,14 @@ static const struct file_operations null_fops = { .uring_cmd = uring_cmd_null, }; -static const struct file_operations __maybe_unused port_fops = { +#ifdef CONFIG_DEVPORT +static const struct file_operations port_fops = { .llseek = memory_lseek, .read = read_port, .write = write_port, .open = open_port, }; +#endif static const struct file_operations zero_fops = { .llseek = zero_lseek, -- 2.39.2