Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1553184ybz; Thu, 30 Apr 2020 01:10:51 -0700 (PDT) X-Google-Smtp-Source: APiQypJv/XJHDjls1kvSPqXKijgPHgvGBSeSZWnn+O1Aico2MH88yqydwK1b4GtmD1inOzc658lG X-Received: by 2002:a17:907:2069:: with SMTP id qp9mr1657608ejb.137.1588234250880; Thu, 30 Apr 2020 01:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588234250; cv=none; d=google.com; s=arc-20160816; b=vBY7asH6czyS5poMlNv1AKaHBAasdXBrg20FcDh6c5R0yCkkXqk9khDfIQ4w8NV/fC HLxqZkzzyMXKKhFrRDm8TEZ4ndYyAdMxXdHie2+Z0IKwLs2IpKkQUO8VNOckSytMf42t WadmkUWJeEVwwulvQ/CLiR4V+ZRjStu/RaLKOEXNC2nGBYNb/16S0IKkVrXZNdGJjqoE JA0wwafCwf2W2aPOgv8VecWgA1cWp/eauR9H8lfznQLRBEI31Wf9gctV2dOeLPYKfnkj vtaL7X5EWUIJQGSSOKek6ZPPUmQi4tJ79/GD5iRnbEEtA6cKq71niY5LCKRl1VCprqGO S5Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b5JN3W2nYomKNbestMqrZy7hkr2w5gTVeef7c9NHaHE=; b=fQfJSn7plPA7sLg1oaDaE8z/l0P+BlHX7e3ZoPAsNriRp4qDyi1qSoWiIbXhBrJUWT vh6CNE54O1S1DYzPSN+XYIUREJvAk5M7LYGa8Ll76AD1fizqL1Rn8C1MCEXRLJlKXeIx +VLUyD6pHB5rtMyaySErjpTRHEaVGbCQisC0nLU0TuWKv6jOfUG/9Jvym2aoRXTCvYAq qzNpu+MhqRVvT15AH1L1KOg+9Wzq8W60+EMh6MBeRgGNf3MW+bsowzsK73ciocL/pC2U L/4DghnkFgxtptzl5UXMk3MF2MQgPOcC3V3ctvQ+AUi2FrPdXuQsnPtaMwBgpruV2Peo BIvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oQl9HLUX; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si4439671edr.464.2020.04.30.01.10.26; Thu, 30 Apr 2020 01:10:50 -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=@kernel.org header.s=default header.b=oQl9HLUX; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbgD3IGr (ORCPT + 99 others); Thu, 30 Apr 2020 04:06:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:50972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbgD3IGo (ORCPT ); Thu, 30 Apr 2020 04:06:44 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E2B4021D7F; Thu, 30 Apr 2020 08:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588234004; bh=TPnP78eeknSuUjBTOPPusY/VNyretW7NK7oJHlas4Mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQl9HLUXC1bDoHro/6k7bDuGT4/va3vFcTfqQah95Ds91OcYxam5zgp1fztDwrhkm YJ4ZOkzb9jv7au88QTp6AAI3Lwaxagd4X77OheNUr1jA2SWwdIKT0EQAyEJk1kV0oH 9GX4b/LmwXHYNqEfExNiGskOZHCmd64cWndBZy2w= Received: by pali.im (Postfix) id 27FA27AD; Thu, 30 Apr 2020 10:06:42 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Rob Herring , Thomas Petazzoni , Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas , Remi Pommarel , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Tomasz Maciej Nowak , Xogium Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v4 03/12] PCI: of: Zero max-link-speed value is invalid Date: Thu, 30 Apr 2020 10:06:16 +0200 Message-Id: <20200430080625.26070-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430080625.26070-1-pali@kernel.org> References: <20200430080625.26070-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Interpret zero value of max-link-speed property as invalid, as the device tree bindings documentation specifies. Signed-off-by: Pali Rohár --- drivers/pci/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 81ceeaa6f1d5..27839cd2459f 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -592,7 +592,7 @@ int of_pci_get_max_link_speed(struct device_node *node) u32 max_link_speed; if (of_property_read_u32(node, "max-link-speed", &max_link_speed) || - max_link_speed > 4) + max_link_speed == 0 || max_link_speed > 4) return -EINVAL; return max_link_speed; -- 2.20.1