From patchwork Fri Sep 15 15:57:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13387206 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA8E3EED60B for ; Fri, 15 Sep 2023 15:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236333AbjIOP6i (ORCPT ); Fri, 15 Sep 2023 11:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236304AbjIOP6S (ORCPT ); Fri, 15 Sep 2023 11:58:18 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E2C610D9; Fri, 15 Sep 2023 08:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694793492; x=1726329492; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oC+J51tGvN01jsQNJsaVvoKnBvB9vBS5Yv0KL0IOWys=; b=B3kJOAr3XSyI4Wieru29LTbHaM12uI63wHR1NMFu3gOb6jJiP8jvgi5M 8ZvYSbjaH/LDOgcXXXz3z16/MAO6z+mOzwjQotduM+mum9HVh5LH2Zzzn nmVXj8BSSqqT3N9piWadqxMEVfyjY+G24apnubCgO75XINLZ+0DIXyZRz B2UyURsHYYG9EZCaKbQBDx0xqXnA1YCH2gW19kMM9lam1g85PUcfkqVZM 860emiZZ1YjHJ0U+Pooktw55x0EHPdiCTGuf6u/x1KYzGJEzx1jAU0cri UylFAH54TitS37FaM61ljGr7VsDdEAUczlXPCr9yDMfRs8J0tmWB1Lxyy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="369594629" X-IronPort-AV: E=Sophos;i="6.02,149,1688454000"; d="scan'208";a="369594629" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 08:58:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="745036695" X-IronPort-AV: E=Sophos;i="6.02,149,1688454000"; d="scan'208";a="745036695" Received: from srdoo-mobl1.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.38.99]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 08:58:10 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 3/7] PCI/ASPM: Return U32_MAX instead of bit magic construct Date: Fri, 15 Sep 2023 18:57:48 +0300 Message-Id: <20230915155752.84640-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230915155752.84640-1-ilpo.jarvinen@linux.intel.com> References: <20230915155752.84640-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Instead of returning a bit obscure -1U, make code's intent of returning the maximum representable value more obvious by returning U32_MAX. Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/aspm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 06f175d8dee5..4cd11ab27233 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -279,7 +280,7 @@ static u32 calc_l0s_latency(u32 lnkcap) static u32 calc_l0s_acceptable(u32 encoding) { if (encoding == 0x7) - return -1U; + return U32_MAX; return (64 << encoding); } @@ -297,7 +298,7 @@ static u32 calc_l1_latency(u32 lnkcap) static u32 calc_l1_acceptable(u32 encoding) { if (encoding == 0x7) - return -1U; + return U32_MAX; return (1000 << encoding); }