Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2217664ybc; Sun, 17 Nov 2019 16:22:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwS6PAS7GkPAxw8cf1DZX4RDCOC6EotzUMQKyLO8gZZ5X945a/uHloYoXEtvOAScv22Lskn X-Received: by 2002:a17:906:5397:: with SMTP id g23mr21496547ejo.93.1574036559734; Sun, 17 Nov 2019 16:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574036559; cv=none; d=google.com; s=arc-20160816; b=xznBEhgZFZuewGYkyLGz6KLMr8B/eMXl9+LYpCpVv0QWpWkA/BOETlNhH4QcCs3lZ8 hF8QwLUWSe64LD/zp9r4YMLr8d6ymowmgJ/Cl3voerKXjv3AuYYZft5iHLeOavLA3KdJ AkbkAD9Vu+yVLOQvJPEAB/nRFqoh5eZya4WYvbECFGjVwkDR/WXNu5ets6s1Lvfd8ckL D4tYz1PCFnPGpj/F0ntQJyoGHUjumSx1ng5YIb0EQwB5K3BfdDlmZDcMRfvtDl8P0o++ fBH4O/KUH+ay4yun8U89XvMRLv6qrLTIEbCCjawDneCG6+7N55zbFEGv9QXCo6oH9s5m 0hCQ== 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=SDNwfNn5T935taTtptdT62qB38KmzsVcQ6J6XQJ53cI=; b=D39naM9o8tRj+uBLCX0KyJkIBAMWHNqnWUa8NbK6rGTgRfysjUnYVZkfTUp2/UTRyP DbzvUb0D8kmnSlOjl6IIj0HnWFOPi4Q+DKPGfmPeLn7YvqihRKngVCcaDmErVSzfdI6n QYSDKhLTa9VkxTdiU0ifKa69hjglI1YKBTty7xxw5/dPjjBlEioKd9av7EhYeTREvm/E FJtGl3HrYBb98Mh4b3Rd4GiMp4eouq9j8umAsKlbGMwHqWU52g/e/n85xNc2aSmsMCRL otixeckRbjNzvMYETDACSRlNHZzgZHNdPHyCZzPLTdHiz6na+WuJZ6EvGjy6/AHfIRJF Gc+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fredlawl-com.20150623.gappssmtp.com header.s=20150623 header.b=aEv5g5+5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ck4si10683580ejb.29.2019.11.17.16.22.16; Sun, 17 Nov 2019 16:22:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fredlawl-com.20150623.gappssmtp.com header.s=20150623 header.b=aEv5g5+5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbfKRAVM (ORCPT + 99 others); Sun, 17 Nov 2019 19:21:12 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:36363 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726284AbfKRAVK (ORCPT ); Sun, 17 Nov 2019 19:21:10 -0500 Received: by mail-ot1-f65.google.com with SMTP id f10so12995196oto.3 for ; Sun, 17 Nov 2019 16:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fredlawl-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SDNwfNn5T935taTtptdT62qB38KmzsVcQ6J6XQJ53cI=; b=aEv5g5+5C6ppRO0EAPEGURQUArJ63u81uTTgvLm4P+Guga1fGGKMS1Nuo8T37b4zV4 zEuuBGKHk131JOaVbjUp/EQHLOIQnVu3zbEgCeAhw5dbdt1tAjHx4aKJbZhJuG+7QFCu zkGZX2Exv2ZNkGsnurlGEWsp7DHnheWdZnl+1nhKFL/wSbaGx1Ec5wcyxebhJ8s+5n/8 hJ0CWQbXD7vb3ZKuDIKO9wJWpMZ4EOMUkjkwndgxNuR5F7g3kPUUdIIx6LnNlSj0J+I7 Mrir+yrv7R+gw8Dqe7MUm+kKc3hRE6f1dRRFXrO70FjfDlF7dentqtYRz6dnx04pOgM0 Ihjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SDNwfNn5T935taTtptdT62qB38KmzsVcQ6J6XQJ53cI=; b=X2EQjcCnq3lgOlPXLgzgdYVVZV2GJ612E8M7kC/Pz8GHq/VlXUSjgINOMlk3wkMW/S 18nVvR2+qTNWy5qhvu2+XKqpocNzbf28fAHW9MeBwP6J9pCU3AVbWQ7Pz67KNC1oxUCe o3U8O0cU2WL1sj+sLfFLDojbkEUnVeindacnxgJOUViUlaWToMNjLNH3uI+DguRRD//G 0h/lRrtGvdff0r/cs6ABEFxwA9JZ6GBNdGfJYeIr3wesWgz25lb1wRBuqwO54meZmMG7 FI5UwIs6mUo+QZvqAmKRqLeUHw35cQ0UTgQPBZORUzceQWq8agR2+TsEOlhttALgJLZi DHaw== X-Gm-Message-State: APjAAAWVNhw2kWv2sXkCroHqLaEsYumZaAqBXVzxrXRfp32zWzY+INve VSNeiWTDfG62SuA7+kc+4TEZCw== X-Received: by 2002:a9d:7ac2:: with SMTP id m2mr20448773otn.135.1574036469452; Sun, 17 Nov 2019 16:21:09 -0800 (PST) Received: from com.attlocal.net ([2600:1700:4870:71e0::10]) by smtp.gmail.com with ESMTPSA id 65sm5532194oie.50.2019.11.17.16.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2019 16:21:08 -0800 (PST) From: Frederick Lawler To: axboe@kernel.dk Cc: Frederick Lawler , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, bvanassche@acm.org Subject: [PATCH v2 2/4] skd: Replace magic numbers with PCI constants Date: Sun, 17 Nov 2019 18:20:55 -0600 Message-Id: <20191118002057.9596-3-fred@fredlawl.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191118002057.9596-1-fred@fredlawl.com> References: <20191118002057.9596-1-fred@fredlawl.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Readability was improved by replacing pci_read_config_word() with pcie_capability_read_word(). Take that a step further by replacing magic numbers with PCI reg constants. No functional change intended. Signed-off-by: Frederick Lawler --- v2 - Added this patch --- drivers/block/skd_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index f25f6ef6b4c7..7f8243573ad9 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -3141,9 +3141,11 @@ static char *skd_pci_info(struct skd_device *skdev, char *str) char lwstr[6]; uint16_t pcie_lstat, lspeed, lwidth; - pcie_capability_read_word(skdev->pdev, 0x12, &pcie_lstat); - lspeed = pcie_lstat & (0xF); - lwidth = (pcie_lstat & 0x3F0) >> 4; + pcie_capability_read_word(skdev->pdev, PCI_EXP_LNKSTA, + &pcie_lstat); + lspeed = pcie_lstat & PCI_EXP_LNKSTA_CLS; + lwidth = (pcie_lstat & PCI_EXP_LNKSTA_NLW) >> + PCI_EXP_LNKSTA_NLW_SHIFT; if (lspeed == 1) strcat(str, "2.5GT/s "); -- 2.20.1