From patchwork Tue Mar 14 12:11:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Schnelle X-Patchwork-Id: 69559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1721073wrd; Tue, 14 Mar 2023 05:16:35 -0700 (PDT) X-Google-Smtp-Source: AK7set+IR/UKlcipamjnx1gKs7dpfou18jM6/xlQqo6oo8kfwgHUlVoqDfSnETxPGxYvB9HFTVVP X-Received: by 2002:a05:6a20:1bdd:b0:cc:a0fd:67bd with SMTP id cv29-20020a056a201bdd00b000cca0fd67bdmr35861186pzb.14.1678796195465; Tue, 14 Mar 2023 05:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678796195; cv=none; d=google.com; s=arc-20160816; b=MamjJQytV+GZidnOxASMtomWXH16S3ySzaSn+rHXR/ZDP7ad3WceVYyPA1VaG6wsSd AmFKWdtAwRMPdVHwOgOImOzxSP0XOPx8M4t0RI+UaFj+70dTga3B7629SXMNCWPluC3d PGLk1kUUQqlMAbKUv6Ebmw5sP1TdCIPyl+SAJPXGbb/KWO+dDBgpNVok3ibi/s9m22mH JSDS/d0Gnoxvg4lrlVlu4yyQgivwk/5dnX+xU6g2l8A69w3nUFl96+y5xo+yxYRdXaA9 PNW5QvBIl9bLxXT2Cg5vkW4JcCq0PgsqRHCIKseRndPv/uiHSWUk+fKAP7wCizRqKWj7 xNZQ== 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=TKtTEtFg0KpNM9JFjaWGwvSFddJ0tToCIWInDElt7TY=; b=iDYwkB2fGgZGzf8QJMtwvaeCO+Jf4rNQhOU3AXzVYXvCyIf5BKRA2naIX97D31rAWv TMLL55udc5qNxhxCwAPTQjKM9zc7Kqsn154f8NmilUu7RbYz6sTYCTnN2iTEAr9UvaKP IKHNEEXsG/cyB/OxFewJcXvgSdQOK7SbWPsZ/mmp8WNG/iZHhzMd25JvQEORciXv6SmV szF0wEhT7HnTSzn4gAeHeFvpyy5GVKAd9gSdqVqSgAmRvB2RbLr/+ah6QIClhXYqLYe5 mEcwQzThWTA5TcOg1y3HakIBv0G2y+1pQDfKPJIoscaDknfSGBaq97kp5IHdzjz5jJKu 7GVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=D3zofCWQ; 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 d29-20020a634f1d000000b004fbfc2b436bsi2178146pgb.517.2023.03.14.05.16.21; Tue, 14 Mar 2023 05:16:35 -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=D3zofCWQ; 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 S229664AbjCNMNY (ORCPT + 99 others); Tue, 14 Mar 2023 08:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjCNMNQ (ORCPT ); Tue, 14 Mar 2023 08:13:16 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5254E73028; Tue, 14 Mar 2023 05:12:44 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32EAjCH3034937; Tue, 14 Mar 2023 12:12:33 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=TKtTEtFg0KpNM9JFjaWGwvSFddJ0tToCIWInDElt7TY=; b=D3zofCWQ3CvLK1bfqw6+qONKTltnjP2CaDwwZUIgQanrVnh7fZrBJuO7Mfr0Uz8s6SYr +2Fl92RAcTnV7m0zntNq0zaJ6Sof44Nbih+MItI2iGL2T+TfaAv/Br5gy7b+78oG4AO7 O2RvOc0RI/3uA2tdFyFq+IkhVD1D2JYxeT16rATCeARIm8YhkCPSjURYfSzXgQ7d001A b+4KxtVPWkPnwg3IQ0wHplNk4w/rXyTB+Zr5o990YGdAvJJSn2+V3D+4WnueKAa433Nm eD+012oqb+yMh08FMuyvKGz0Qh6XqZtfIWgpVT0w8vuk0dw7T3cqjD5rc4h5zZrXvttD 4w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pampuq6au-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Mar 2023 12:12:32 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32EB7c1u020724; Tue, 14 Mar 2023 12:12:31 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pampuq6a2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Mar 2023 12:12:31 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32E74xMQ000962; Tue, 14 Mar 2023 12:12:29 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3p8h96mrvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Mar 2023 12:12:29 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32ECCRhF24183332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Mar 2023 12:12:27 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5954D2007E; Tue, 14 Mar 2023 12:12:27 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECA552007C; Tue, 14 Mar 2023 12:12:26 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 14 Mar 2023 12:12:26 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann Cc: Greg Kroah-Hartman , Bjorn Helgaas , =?utf-8?q?Uwe_Kleine-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 v3 08/38] firmware: dmi-sysfs: handle HAS_IOPORT=n Date: Tue, 14 Mar 2023 13:11:46 +0100 Message-Id: <20230314121216.413434-9-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230314121216.413434-1-schnelle@linux.ibm.com> References: <20230314121216.413434-1-schnelle@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 5D2GeK2lfhUzgUj1z-XpW4ybXtIdDIOH X-Proofpoint-GUID: 6pUhpaPGiHMX6be7SpQVcB6Gkbcgyfk1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-14_04,2023-03-14_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 mlxlogscore=999 spamscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303140103 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760345399823738774?= X-GMAIL-MSGID: =?utf-8?q?1760345399823738774?= 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 Signed-off-by: Niklas Schnelle --- 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 ed5aff0a4204..22ca1af4e363 100644 --- a/drivers/firmware/dmi-sysfs.c +++ b/drivers/firmware/dmi-sysfs.c @@ -310,6 +310,7 @@ static 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);