From: Ilpo Järvinen Date: Fri, 15 Sep 2023 15:57:48 +0000 (+0300) Subject: PCI/ASPM: Return U32_MAX instead of bit magic construct X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=69bb38b77486b114b56b1174d74bb97d66045697;p=linux.git PCI/ASPM: Return U32_MAX instead of bit magic construct Instead of returning a bit obscure -1U, make code's intent of returning the maximum representable value more obvious by returning U32_MAX. Link: https://lore.kernel.org/r/20230915155752.84640-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas --- diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 06f175d8dee57..4cd11ab272330 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); }