Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2746197rwd; Mon, 22 May 2023 03:53:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57pw7G8sbBlf1Ryd5joKnh9VS1+9burot8KA8jt80JadYH4JxeXd14qAXOeBMoKpFK/m7/ X-Received: by 2002:a05:6a00:134c:b0:64c:9972:f742 with SMTP id k12-20020a056a00134c00b0064c9972f742mr14798093pfu.8.1684752780886; Mon, 22 May 2023 03:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684752780; cv=none; d=google.com; s=arc-20160816; b=e4rSn6HNpMfCFR53+AYE1p0Sve+xaFk+yAJa2NRFX6ZkngtJMoVKEvEkc+XplFstV6 jeyWYMpMrH6EUmyZKNdBIVEN/cTCozkO5RBC4DTLl/HpUnaY5h4IrJqlasYs1OdY1MF9 aYB9K/o56neNjUssc1noYb6DuxWmFibSBXJasTpa0ALPhNdCjk8PCPXCdG38piDoutc6 0Vq2xKUHFjA0RZkHD+u2QVzchqYRQR1k2Q/tCKsFfey1HXyotHt6RQ+yD3fgYgk2W/a9 USotyD+z+cX1XrWSWy5ZKsrNIRpAII36UmjrLqn3KjfJQKYFeXe9APvQzopRbeBeMXhH kaZQ== 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=r0iP2dEhZ9OVhEy+tAYdX8nt+/qP3QrB+sF2qrnjCU0=; b=gP5JCFxa2EsSDzMFyfTfrUHEr4hy5NHola0ysmUmUqcsXARkh1VlWuSLEunQbZFpTq j/R/hjYSSo9RtwGX3opUTjBdV/Zom5uUUzxAkyj9Z2lzlGpGkMvJcjlq6/ketfB1vWMT xpSJYbzXCePSSBEnWUL/uDg00IMgeAbymT9Dv2PLVGaDQ+Y4+LUTEzJqHct5TGxMBY2H /cwqCfOQtC1+K89aG6Ms5z8MI3SLTbo2OTXHevDeXc/4LF5/QD2OSLy55BqFIJko7e4D h82WsypSbvnLTXpzyQbYsbxm9lqof90JpGQqTJS13AZKKl4Ga7EbCjG2yJm/6eJMux8q n6dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Kv5scphL; 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 q17-20020aa79831000000b0063b8685bab4si4602859pfl.113.2023.05.22.03.52.45; Mon, 22 May 2023 03:53:00 -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=Kv5scphL; 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 S232858AbjEVKva (ORCPT + 99 others); Mon, 22 May 2023 06:51:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232729AbjEVKvO (ORCPT ); Mon, 22 May 2023 06:51:14 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00519E0; Mon, 22 May 2023 03:51:12 -0700 (PDT) Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34M8qKGI022751; Mon, 22 May 2023 10:51:02 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=r0iP2dEhZ9OVhEy+tAYdX8nt+/qP3QrB+sF2qrnjCU0=; b=Kv5scphL2k5l8GIPc9rHapIah5Tfr73ny9C12+iNRPhMo3qmlKQ1ftu6SEttZjVO2Qoe n0mh2QJ6t6kkvXM86rteooz/hS1Y9foQKT3pZfnOBweBdDYISu/rcA7qGNOd6vvap86o DdxhmV2mt8IgGQ2mkvqtPXJMHgr/G+IkBvsjWlBok0dffgB3gByUO9FCMnCZAuPF0Jqa gYE+H8GPUowRGdEKHyWpyIn7oam+sVQ51TKEogiFHKeSG6Z6BTlN3isW39pNsHCyeTRI 6XSif9mhGbjJ4JpBXn9NZhl9PU3EEckPPHFORTRQWdPRZ0JhxxVhjR/w9Jo9xHmpdrAP 3Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqd3tc92p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:01 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34MAp1YB013361; Mon, 22 May 2023 10:51:01 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqd3tc923-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:01 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34M8tUbC032622; Mon, 22 May 2023 10:50:59 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3qppc3gw80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:50:59 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34MAouFo21562068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2023 10:50:56 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CA2020043; Mon, 22 May 2023 10:50:56 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4EC7720040; Mon, 22 May 2023 10:50:56 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 May 2023 10:50:56 +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 v5 08/44] /dev/port: don't compile file operations without CONFIG_DEVPORT Date: Mon, 22 May 2023 12:50:13 +0200 Message-Id: <20230522105049.1467313-9-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522105049.1467313-1-schnelle@linux.ibm.com> References: <20230522105049.1467313-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: iuzYpcytujTIHbBo2tvThISxULnSw31E X-Proofpoint-GUID: Y_ZqzBhtPlF6aLytqsbY7WFAyeE3H6TF 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-22_06,2023-05-22_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 impostorscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305220089 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 --- 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