Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3759093iob; Mon, 2 May 2022 05:08:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz9pVPS7sON6gl9rRtVmxZvPK/i2PwEJvpy/N0gJ5nuMdaFFO+k1jNBwQNW78Z5siFJzES X-Received: by 2002:a17:903:228e:b0:15e:9462:b058 with SMTP id b14-20020a170903228e00b0015e9462b058mr8633031plh.64.1651493300985; Mon, 02 May 2022 05:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651493300; cv=none; d=google.com; s=arc-20160816; b=wTEJYdCuRIXDBgD3wl/+R+tzOlReA00+Qffr3UiNy4g6gbuD0W5pNOwcGgaC0iBH+t 8zDCujg0D4LFclaOALqJgsOstt2IDN9td8/oTJeIaDuM47XArw6q7KJse/5uPMGsPne8 EIeHkg4CEsRbIZdH9Ii/kmpmbKSvaPtfl4Z5N0T2U6t0nNDwxdNx7bOyx/4p0+u2ou/G lSvURu9D3IuPPO1k2DYF6vTrhzEAqeUDYe7vapl6yjcO7m6UX7eNQExjve/MqHdre/Yo /C42r/UKbhH9IE3YU23JP29QOND2OOybkMCPPYcqCi6U7wkXvzCTcv9dfFY+UOzFCMo9 wS+w== 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=RcNkQX5z7RIrwJgtlTJ9IWhaRouQF0bHtS4kZ+78lL0=; b=R9Ltw5DDVJ7wF7946A8rlzQINw7+CaCkdZHqzXaHuwgszAdcg5+8n1K63+k9LpH4ri HstThZnmBYfhIeX5+Nh6NPP99TvwfOjLmIKmts7/F/O33/gYS1JJ8I3txrM72Q8p0oKA 2xhXPW07Kl5wWBqBqiw+q6ODDjXl8XPjVTzN5PFJfSM8nV7HBlbsWCR7Z99kBWWBEUoF dWLtzVTpsrnJUoT8sYjkE5fdXfFPpREP9N2zeERf1O4/0DP++Sg1AKXI07Gn3kBa4GPD xrSeImlzzob2bw3U36XbcK9rFgDtNeXwf0nx6/NcDYpN60Hbnzn7QbsYNXS/m4VJcQbL 0o/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=MTntOLe8; 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=NONE 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 ip13-20020a17090b314d00b001dbcb8cc937si12668740pjb.71.2022.05.02.05.08.05; Mon, 02 May 2022 05:08:20 -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=MTntOLe8; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376500AbiD2NzM (ORCPT + 99 others); Fri, 29 Apr 2022 09:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376420AbiD2Nyo (ORCPT ); Fri, 29 Apr 2022 09:54:44 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C01F58E5C; Fri, 29 Apr 2022 06:51:26 -0700 (PDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23TDh14N008386; Fri, 29 Apr 2022 13:51:21 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=RcNkQX5z7RIrwJgtlTJ9IWhaRouQF0bHtS4kZ+78lL0=; b=MTntOLe8y/IQxsWvDKiRD/6443iR4gjE1lr9zf5anmFH17PHkY2lGGwwhtTlLhJ8JtTM Yv1gPNMFUQ2/B7UUnyxYJz/x8x5dslYM1xvQExNcAgr2pgwRsUpzuwQ1JFt1t/WvKX7o /2rO57OPmjH8j+y9lA9XFo0WIrXoFJT/ItT7zVSIT7OGOeQb53EZKQ/HUX3jmoe4fFut NduR4BUM1pl+eraWyB+nnAdwmevySqS7PJvVhV8atx4cPFxowE7WeobSfuaf3K48MV8K 55O6gPFB9Ph6uo6WWsK4OEp0mjdbB4lGLM5n6Y1pPSNlyh+1cDkjUcXtE4hmXjnBZE9H FA== Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3frh55r5j9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:21 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23TDQkXO015912; Fri, 29 Apr 2022 13:51:19 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma02fra.de.ibm.com with ESMTP id 3fpuygb96q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:19 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23TDpPoF22479328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Apr 2022 13:51:26 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59E824C046; Fri, 29 Apr 2022 13:51:17 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 202F64C044; Fri, 29 Apr 2022 13:51:17 +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:17 +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: [RFC v2 07/39] /dev/port: don't compile file operations without CONFIG_DEVPORT Date: Fri, 29 Apr 2022 15:50:10 +0200 Message-Id: <20220429135108.2781579-13-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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: oW5JTgQc-9XdQz-_KDaeTiCRzq8Xdcp_ X-Proofpoint-GUID: oW5JTgQc-9XdQz-_KDaeTiCRzq8Xdcp_ 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 spamscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 clxscore=1015 mlxlogscore=913 priorityscore=1501 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204290078 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: 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 cc296f0823bd..c1373617153f 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) @@ -665,12 +667,14 @@ static const struct file_operations null_fops = { .splice_write = splice_write_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.32.0