Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp777458pxa; Sat, 1 Aug 2020 05:57:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxALzw5dJakTv2Sfg/JaVfxEYZSMkIUyL/pOCldnHjsURumcgENcbK8iOk4kpW5d+z2gZiB X-Received: by 2002:a05:6402:22d9:: with SMTP id dm25mr8071352edb.2.1596286637173; Sat, 01 Aug 2020 05:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596286637; cv=none; d=google.com; s=arc-20160816; b=xo2N8mGvtOJ0iNOSy/kOHbIwmVfTtEkwDqSIn8ZR/7jHoiqUu73n33biujGEKQYPCR tIuLS4yKPqcxzKYi+fbgKUAnYq0JucQ+J9K4P2nndO0MU7Ri7N313RfTtNz+lTGBclH4 2aq9/6iBBo3ovnYha/rD0Myi0n11DeA18nAAfBpYOOcGxnGLwpntkZIbjCCCgnLI4QPq 6VJ9ZPo8u0JAkdPqnfUu/o1GtynrxmvS8rF+s3+0iJkeUjE0IUeu2juqosG0t32L3tKy DhQStNs840DNxLmGdor4ZsqhSxnvg3fSoioApGRoXYW+x0+4RLG61as3s4Pek3PMcgSa eVmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NfmlZOrLaBmBGlzbXE5z6x4RKpqqJJmlzC4+91fmYUA=; b=aWBSgTePAl19SgQwmP5zBo0qcfYQExZZoEtP5lIN78Vst3hHgUo7PD2wqFxDrUSzqw cPCmHk9a+s9ktCjWmVDW/J4LaZ6C2V6hdY00o/cc1Cb3atDXTxcqWginFd6QqNU2A/6h s9D4xdHR47vyWRzXX6rp7o3Wt2gGz26WmdXdNkE9ofK1nA7grKHQILlGGayPt6Rn3Hcz 9yGw1/qoBf1Nxy/106Ul1ur4joQr64AXw9kctSQDQisuBag3QbGI2mmmcTajGMVyIv+8 K/lM2phFXC5X0JdR24QHWvMlUSNEZBUAiXnXCM+/J+m50uOvQl6adqU9DHC5nMfFUdB6 hU+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="n/7VNWjN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si7619265eja.38.2020.08.01.05.56.54; Sat, 01 Aug 2020 05:57:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="n/7VNWjN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728994AbgHAM4s (ORCPT + 99 others); Sat, 1 Aug 2020 08:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726471AbgHAM4q (ORCPT ); Sat, 1 Aug 2020 08:56:46 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 666AAC06174A; Sat, 1 Aug 2020 05:56:46 -0700 (PDT) Received: from nazgul.tnic (unknown [78.130.214.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B8CAE1EC02FA; Sat, 1 Aug 2020 14:56:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1596286602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=NfmlZOrLaBmBGlzbXE5z6x4RKpqqJJmlzC4+91fmYUA=; b=n/7VNWjNwrVYldmM5JNyqQEVZd3Vp3hpjJSMuFhfSkrW8mQhIHtpfasKy9w1BEromsKKyZ /CdJ8nlcvZTCqyn05aBVgUH+WGtmqEhe61zMEoDcH8PmujGuHYORgBg9sVbSuZSh5qLljK uihuEhdcnAWg6tPbjyrRXoOKhqTEw/0= Date: Sat, 1 Aug 2020 14:56:57 +0200 From: Borislav Petkov To: "Saheed O. Bolarinwa" Cc: helgaas@kernel.org, Kalle Valo , "David S. Miller" , Jakub Kicinski , Wolfgang Grandegger , Marc Kleine-Budde , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joerg Roedel , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-mtd@lists.infradead.org, iommu@lists.linux-foundation.org, linux-rdma@vger.kernel.org, linux-ide@vger.kernel.org, linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-gpio@vger.kernel.org, linux-fpga@vger.kernel.org, linux-edac@vger.kernel.org, dmaengine@vger.kernel.org, linux-crypto@vger.kernel.org, linux-atm-general@lists.sourceforge.net Subject: Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value Message-ID: <20200801125657.GA25391@nazgul.tnic> References: <20200801112446.149549-1-refactormyself@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200801112446.149549-1-refactormyself@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 01, 2020 at 01:24:29PM +0200, Saheed O. Bolarinwa wrote: > The return value of pci_read_config_*() may not indicate a device error. > However, the value read by these functions is more likely to indicate > this kind of error. This presents two overlapping ways of reporting > errors and complicates error checking. So why isn't the *value check done in the pci_read_config_* functions instead of touching gazillion callers? For example, pci_conf{1,2}_read() could check whether the u32 *value it just read depending on the access method, whether that value is ~0 and return proper PCIBIOS_ error in that case. The check you're replicating if (val32 == (u32)~0) everywhere, instead, is just ugly and tests a naked value ~0 which doesn't mean anything... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette