From patchwork Sun Mar 27 07:20:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiu Zeng X-Patchwork-Id: 8675471 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA7619F36E for ; Sun, 27 Mar 2016 07:21:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E97EF2022D for ; Sun, 27 Mar 2016 07:21:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E7CD20219 for ; Sun, 27 Mar 2016 07:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753309AbcC0HVX (ORCPT ); Sun, 27 Mar 2016 03:21:23 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36254 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752874AbcC0HVW (ORCPT ); Sun, 27 Mar 2016 03:21:22 -0400 Received: by mail-pf0-f194.google.com with SMTP id q129so16814512pfb.3; Sun, 27 Mar 2016 00:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=DP2kRaNmStrl3XPhSDjF+mMO9BQL9Q9/MRFuggfCVwE=; b=To7G14a5dFa32S+DuwOyCReD6TvBy6q+tZHKf5OjpWp4jbBdsIGdW7H1JxPAY7Uv3b wnTr/AS2gW42/jrinJGNA9WgoI15hpdBPHG7m06h6iOdBtJDnHayzupjl84rllikuzKS lSj9mjgTlzbl43Zv+ql0jbUrocthMUY6icBEV7oWw9BY78buM2ug1DqHtCWdAKcaZzXe h0255LusOh0cbLt4y7LFVnq++JCCMSPB0yfd1WI2kGu8m/gtqgRPNPBSGxrgxEHDlIxz jlRHvV9H8q8pLMIqBAVliH/IjlH2JJ+Y8pLg9t4kbImHMPsVYUJy8/LyY6splBnjYphY YBdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=DP2kRaNmStrl3XPhSDjF+mMO9BQL9Q9/MRFuggfCVwE=; b=DURbreuhVPor4F6FDv8skDuZLPCsS5wdBk722Ia8DF4t5jvPK0HD2mDVy6JgBkSi7V uYyZ01oOlBtsTQokgVr2xS1VUIuOx0s449CYD075yhoNaBCycxFGtoucw/t1pOs5Fr2V THEeQ6S7uqqQOrB1m/YWWKWV34XKVwfzBa89VH0HBY5SUq0qYRsc2dQUmsTATAi+KERA FYg/XW0kSeFK0x6NlWSTFD4y8RvuFAT5LiNon2dW3a4wPRfY2P3xAB59LX/PqBBxUzXY a6wmBxMrVvp+K1JqqMykJU8+vCyoCnTMUwqWs8JRSjlrBo3X29xbvP9Va9GLcIXxoN6h 9+Lw== X-Gm-Message-State: AD7BkJIOQCyFtQMfc/naRRWO6iZxgDrGZZApkQTNeAtHK8ZP8ufgL+YycPUD6b0ajk6yTw== X-Received: by 10.98.12.153 with SMTP id 25mr33158494pfm.27.1459063281572; Sun, 27 Mar 2016 00:21:21 -0700 (PDT) Received: from [0.0.0.0] (tor-exit4-readme.dfri.se. [171.25.193.78]) by smtp.googlemail.com with ESMTPSA id o71sm27004851pfj.68.2016.03.27.00.21.04 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2016 00:21:21 -0700 (PDT) Subject: [PATCH 20/31] scsi: use parity32 in isci/phy.c To: Intel SCU Linux support , Artur Paszkiewicz , "James E.J. Bottomley" , "Martin K. Petersen" References: <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com> Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org From: "zhaoxiu.zeng" Message-ID: <56F789D3.3060603@gmail.com> Date: Sun, 27 Mar 2016 15:20:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- drivers/scsi/isci/phy.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index cb87b2e..0b87ff4 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; @@ -223,19 +221,11 @@ 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. + * are transmitted shall have an even parity. If parity indicates + * there are an odd number of bits set, then set the parity bit + * to 1 in the phy capabilities. */ - 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) + if (parity32(phy_cap.all)) phy_cap.parity = 1; writel(phy_cap.all, &llr->phy_capabilities);