Message ID | 20230516110038.2413224-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 b10csp336632vqo; Tue, 16 May 2023 04:04:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7yun5SJIgrcNUClsFj6beppVOzfx6rSB/cNh+csRTjwNdUadWFlfs1LJtn5rKqNLBN4UGg X-Received: by 2002:a05:6a21:3290:b0:100:9969:8cf with SMTP id yt16-20020a056a21329000b00100996908cfmr39223807pzb.49.1684235049081; Tue, 16 May 2023 04:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684235049; cv=none; d=google.com; s=arc-20160816; b=i7A0qgN8xP7R9tCRLZUDVvbmglcf4DG9c4KD/Fx50bIaHbNZ634vEZyXKQ8aqttEU+ /WxV1vFl2zsQqgfyRPxGTzGR640qUaZAo3GPVOhaEeHxSmDlIcQfEbBQ8QNsxZ+Xam4L 3Mv+rurqO+iz1m4jbjP5JAzoiwnOXHt5F9BdDxkDUxRasAQi+5xWFu6LC/kWlWZ0ceyr +grEbzNpuJkoLkMLU2XSIOYhPufMqCSp7rDs2CComFd6fVhoOulVqEbvgoy5GD7WNaVu fSkrfmc8N/fg4dudH0vHos1QZ0ec3Y21fk+zE3MjlDzg98xk4IBpnpeWsKBhXmVcxHoR uU2Q== 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=4int1kjqF41DPx5zg9+PA5H/N4NQLtA1JExxtuv2Ff0=; b=HlJYfDb3DbAqgZhUXbeH65RkwzhZ/fsW+CzjzacyW3pN6Oz9jIr+9nxHL5oZ6AztJ8 u8Gsp92mJ7FuqI80sqpOP2Wf9uGIsAHBa2RJmNsEsNPEHQlcaSTrUy2oIDl5YuFbsgkp 6wOzXT+LSyCfvXUIeugFevahtRQ5aqrssKtFr0OiC5EEwqDiD1nnGr6vnx82DOsrCKUt v1N0/kk3ta2BQbSKs9EoVnH9sfnozg2wQb6xhjVvt3Ji0QCh5whdbOriNUA+XqwwYONf O1vXZl+Fe/UOIihL3WKJjPmCC/N/4YhgJHM/ntwzMdSe2JP6idzG34JG+nuDRBfdTI6y 3NwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=phUDuwWM; 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 c10-20020a056a00008a00b0063b21db5973si19312607pfj.358.2023.05.16.04.03.53; Tue, 16 May 2023 04:04:09 -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=phUDuwWM; 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 S230313AbjEPLCe (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Tue, 16 May 2023 07:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232576AbjEPLBv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 16 May 2023 07:01:51 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ABFF5FD6; Tue, 16 May 2023 04:01:14 -0700 (PDT) Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GAeqt1017144; Tue, 16 May 2023 11:00:52 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=4int1kjqF41DPx5zg9+PA5H/N4NQLtA1JExxtuv2Ff0=; b=phUDuwWMNQeUAJIZz+bXHoi1ml8hfqAjuD7yMoDRqy6SvuOn9eGPHSftX2IenRpuWKtO GNRA9Yj5q6BcDxeYj5Pxvwk8xjFaYEZlWq8pVnFsN2m7/lmLhRy+ztE60ZNEyr40hS0H fqfTYW8oCQN0SCXIZp9gIRH8Dj8plfZnHzbB7oz/o5O5TqIkC6j7iYmwAb6YESVAvU6/ ULDAuK6BtBDnr3qEcNvbNce7GUbp+Beh6ZA13wstn+KwnCi2lc4JkOe0NUgrIQjf+OrJ p0rfw1b0run/L0bDxMzWPdekH84M7T5xK+NmPCP0iZIiFfOKjkl63oW1cfkgqgCFURA3 gQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm82f0pcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:51 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34GAfOXV018387; Tue, 16 May 2023 11:00:51 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 3qm82f0pb5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:51 +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 34FMqI0w023513; Tue, 16 May 2023 11:00:48 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3qj1tdsjr1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:48 +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 34GB0kQm19792550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 May 2023 11:00:46 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2FE5E20043; Tue, 16 May 2023 11:00:46 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D502A20040; Tue, 16 May 2023 11:00:45 +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:45 +0000 (GMT) From: Niklas Schnelle <schnelle@linux.ibm.com> To: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, 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 v4 08/41] firmware: dmi-sysfs: handle HAS_IOPORT=n Date: Tue, 16 May 2023 13:00:04 +0200 Message-Id: <20230516110038.2413224-9-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: EEZKUspNFMEFTFfJBaJ1L2jvXLrPzlpQ X-Proofpoint-ORIG-GUID: zUjvG_OPuYIgwivFmXsnhMyV3Up18H5c 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 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=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: <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?1766048450933715559?= X-GMAIL-MSGID: =?utf-8?q?1766048450933715559?= |
Series |
treewide: Remove I/O port accessors for HAS_IOPORT=n
|
|
Commit Message
Niklas Schnelle
May 16, 2023, 11 a.m. UTC
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to guard sections of code calling them as alternative access methods. 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> --- Note: The HAS_IOPORT Kconfig option was added in v6.4-rc1 so per-subsystem patches may be applied independently drivers/firmware/dmi-sysfs.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c index 03708ab64e56..8d91997036e4 100644 --- a/drivers/firmware/dmi-sysfs.c +++ b/drivers/firmware/dmi-sysfs.c @@ -310,6 +310,7 @@ static const struct kobj_type dmi_system_event_log_ktype = { .default_groups = dmi_sysfs_sel_groups, }; +#ifdef CONFIG_HAS_IOPORT typedef u8 (*sel_io_reader)(const struct dmi_system_event_log *sel, loff_t offset); @@ -374,6 +375,7 @@ static ssize_t dmi_sel_raw_read_io(struct dmi_sysfs_entry *entry, return wrote; } +#endif static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry, const struct dmi_system_event_log *sel, @@ -409,11 +411,13 @@ static ssize_t dmi_sel_raw_read_helper(struct dmi_sysfs_entry *entry, memcpy(&sel, dh, sizeof(sel)); switch (sel.access_method) { +#ifdef CONFIG_HAS_IOPORT case DMI_SEL_ACCESS_METHOD_IO8: case DMI_SEL_ACCESS_METHOD_IO2x8: case DMI_SEL_ACCESS_METHOD_IO16: return dmi_sel_raw_read_io(entry, &sel, state->buf, state->pos, state->count); +#endif case DMI_SEL_ACCESS_METHOD_PHYS32: return dmi_sel_raw_read_phys32(entry, &sel, state->buf, state->pos, state->count);