From patchwork Tue Aug 22 09:56:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 9914671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 58C8C600C5 for ; Tue, 22 Aug 2017 09:57:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68D8C28788 for ; Tue, 22 Aug 2017 09:57:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DC072884F; Tue, 22 Aug 2017 09:57:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0687728788 for ; Tue, 22 Aug 2017 09:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932538AbdHVJ5z (ORCPT ); Tue, 22 Aug 2017 05:57:55 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:38325 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932469AbdHVJ5y (ORCPT ); Tue, 22 Aug 2017 05:57:54 -0400 Received: by mail-wr0-f170.google.com with SMTP id p8so56540398wrf.5 for ; Tue, 22 Aug 2017 02:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1tY9NmwRD4CH/krimMiWb1WQC7YmppqD1blbSLsUVrQ=; b=How2pXLYCqYru2p1pGDpKJhWGwt1O592HqZJAgNymMPX3QMfrlxR3GV6f57idhuKGO zfWGGYI+0jz7kyfu2qBK5PlNYaaFtW5t+JJ+6uoyx2zX0UcWxNxTv+zQHw2TUOiHgT0r kRF6JWfUY2FiIfApbpPhDGyxfa/PliNCYUhUM= 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; bh=1tY9NmwRD4CH/krimMiWb1WQC7YmppqD1blbSLsUVrQ=; b=Cy6J5qHCpBHCSf57VhFIJhqQ7VbzmrmS6Vu3KEESc4Zni1L1l9n8k1szrPJd/cSrRf vLJneQYYj8yvGfrF8/znbcFusbLV9a8FgUJtfM5nkwZdRqU3We3XlR7duWLCMu5delZX 7aXsx+qyCMAp/TkGclnCSXURcDLA8JVBhIx67Ft3VFe9qF9XPOTL500zxpVV75oU75pD DC6RW6wjzUSHTJe3tvaZci38aC4f19dEE8jFd1KUBOLfIdFi25O1g8lp4Bkpe3wx/a0e BJNa/M8H7fFalem6Yk7vEi06wY599/mynD6L/0+mlxhJ8MweE2TOOUO3abTQMGixvi9x EzfA== X-Gm-Message-State: AHYfb5j1CgLrLiDycTfodFxVbA6wxgugVUO6QIcKRhVLwiclPxv1KrxJ iQ/jP5TeNcRry8KQ X-Received: by 10.223.129.166 with SMTP id 35mr84417wra.9.1503395872919; Tue, 22 Aug 2017 02:57:52 -0700 (PDT) Received: from anup-HP-Compaq-8100-Elite-CMT-PC.dhcp.avagotech.net ([192.19.237.250]) by smtp.gmail.com with ESMTPSA id e137sm12257913wma.29.2017.08.22.02.57.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Aug 2017 02:57:52 -0700 (PDT) From: Anup Patel To: Vinod Koul , Dan Williams Cc: Florian Fainelli , Scott Branden , Ray Jui , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Anup Patel Subject: [PATCH v3 04/17] dmaengine: bcm-sba-raid: Remove redundant next_count from sba_request Date: Tue, 22 Aug 2017 15:26:53 +0530 Message-Id: <1503395827-19428-5-git-send-email-anup.patel@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503395827-19428-1-git-send-email-anup.patel@broadcom.com> References: <1503395827-19428-1-git-send-email-anup.patel@broadcom.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The next_count in sba_request is redundant because same information is captured by next_pending_count. This patch removes next_count from sba_request. Signed-off-by: Anup Patel --- drivers/dma/bcm-sba-raid.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c index 6fa3df1..e8863e9 100644 --- a/drivers/dma/bcm-sba-raid.c +++ b/drivers/dma/bcm-sba-raid.c @@ -111,7 +111,6 @@ struct sba_request { /* Chained requests management */ struct sba_request *first; struct list_head next; - unsigned int next_count; atomic_t next_pending_count; /* BRCM message data */ void *resp; @@ -221,7 +220,6 @@ static struct sba_request *sba_alloc_request(struct sba_device *sba) req->flags = SBA_REQUEST_STATE_ALLOCED; req->first = req; INIT_LIST_HEAD(&req->next); - req->next_count = 1; atomic_set(&req->next_pending_count, 1); dma_async_tx_descriptor_init(&req->tx, &sba->dma_chan); @@ -342,8 +340,7 @@ static void sba_chain_request(struct sba_request *first, list_add_tail(&req->next, &first->next); req->first = first; - first->next_count++; - atomic_set(&first->next_pending_count, first->next_count); + atomic_inc(&first->next_pending_count); spin_unlock_irqrestore(&sba->reqs_lock, flags); } @@ -1501,7 +1498,6 @@ static int sba_prealloc_channel_resources(struct sba_device *sba) req->sba = sba; req->flags = SBA_REQUEST_STATE_FREE; INIT_LIST_HEAD(&req->next); - req->next_count = 1; atomic_set(&req->next_pending_count, 0); req->resp = sba->resp_base + p; req->resp_dma = sba->resp_dma_base + p;