Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964820AbcDFJsS (ORCPT ); Wed, 6 Apr 2016 05:48:18 -0400 Received: from m50-133.163.com ([123.125.50.133]:53738 "EHLO m50-133.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754310AbcDFJsQ (ORCPT ); Wed, 6 Apr 2016 05:48:16 -0400 From: zengzhaoxiu@163.com To: intel-linux-scu@intel.com, artur.paszkiewicz@intel.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiu Zeng Subject: [PATCH v2 19/30] scsi: use parity32 in isci's phy Date: Wed, 6 Apr 2016 17:47:04 +0800 Message-Id: <1459936024-7866-1-git-send-email-zengzhaoxiu@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <57031D9D.801@gmail.com> References: <57031D9D.801@gmail.com> X-CM-TRANSID: DdGowADnXpMa2wRXKJ2TAQ--.15643S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7ArW5Xr4xJFWUJFW3GFWfKrg_yoW8JFW8pa 1fJ347Z3y8Wr17Zw1UJ3W8JF409ay8GFy3JrZxGas5ZFn7ArWj9r43A3yrXFyakry0gFW2 qFs5WF9rZFsIyrUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jXqXLUUUUU= X-Originating-IP: [112.95.225.98] X-CM-SenderInfo: p2hqw6xkdr5xrx6rljoofrz/xtbBygBDgFO+iq8q5QAAsO Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1278 Lines: 43 From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/scsi/isci/phy.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index cb87b2e..a06aff6 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isci/phy.c @@ -122,8 +122,6 @@ sci_phy_link_layer_initialization(struct isci_phy *iphy, int phy_idx = iphy->phy_index; struct sci_phy_cap phy_cap; u32 phy_configuration; - u32 parity_check = 0; - u32 parity_count = 0; u32 llctl, link_rate; u32 clksm_value = 0; u32 sp_timeouts = 0; @@ -225,18 +223,7 @@ sci_phy_link_layer_initialization(struct isci_phy *iphy, /* The SAS specification indicates that the phy_capabilities that * are transmitted shall have an even parity. Calculate the parity. */ - parity_check = phy_cap.all; - while (parity_check != 0) { - if (parity_check & 0x1) - parity_count++; - parity_check >>= 1; - } - - /* If parity indicates there are an odd number of bits set, then - * set the parity bit to 1 in the phy capabilities. - */ - if ((parity_count % 2) != 0) - phy_cap.parity = 1; + phy_cap.parity = parity32(phy_cap.all); writel(phy_cap.all, &llr->phy_capabilities); -- 2.5.0