Message ID | 20230522105049.1467313-9-schnelle@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1365756vqo; Mon, 22 May 2023 04:14:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64ztE+St5eJX2XyY38pJz63YRYQZ4SbJk0enKMl8lifsqNhGaeoy7NNqDJGY8d7QiCz58c X-Received: by 2002:a17:90b:1a8e:b0:250:a4f5:fb34 with SMTP id ng14-20020a17090b1a8e00b00250a4f5fb34mr10122186pjb.2.1684754043991; Mon, 22 May 2023 04:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684754043; cv=none; d=google.com; s=arc-20160816; b=uKeRpsbgtmxYUJ59ndqAmWF90F3jRMc2YxJ04sXJRQDIA9AWIPQOtEDAq8qURim7Y4 ygKcRbXdB0tfE1VHN84LCr2q4yv1MR5Rf35f7v3GH4okMlnMzdpOr1ypT+gCYK+QKtfV U7MM//4EFoGqr9HUTziLH+h1KX1WqkMRCg/nGixwt5C49coOl35NMqt/54DUnOPESo90 cEOmA7eabr8yad3l80VpSoLiXgaXM5+vLB1obfepiD8t9biMCCPMUzTgZTXr1F7VH7jy Yis5Fg7zT3HjyHqB/OeNCzMoaJJrHuGaElZoYNfvenYSuqXgyoDYPmWy/gG329ZSSijW PUgQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v62-20020a638941000000b005346bd7dee9si4484870pgd.682.2023.05.22.04.13.49; Mon, 22 May 2023 04:14:03 -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 S232859AbjEVKvb (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Mon, 22 May 2023 06:51:31 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <schnelle@linux.ibm.com> To: Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Bjorn Helgaas <bhelgaas@google.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Mauro Carvalho Chehab <mchehab@kernel.org>, Alan Stern <stern@rowland.harvard.edu>, "Rafael J. Wysocki" <rafael@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann <arnd@kernel.org> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766592656704323160?= X-GMAIL-MSGID: =?utf-8?q?1766592656704323160?= |
Series |
treewide: Remove I/O port accessors for HAS_IOPORT=n
|
|
Commit Message
Niklas Schnelle
May 22, 2023, 10:50 a.m. UTC
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 <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> --- 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,