From patchwork Tue Aug 1 10:37:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 9874183 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 4CD1A60365 for ; Tue, 1 Aug 2017 10:42:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59F582853E for ; Tue, 1 Aug 2017 10:42:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E7DA28689; Tue, 1 Aug 2017 10:42:46 +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 DF5F82853E for ; Tue, 1 Aug 2017 10:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751970AbdHAKiu (ORCPT ); Tue, 1 Aug 2017 06:38:50 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:34652 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbdHAKiq (ORCPT ); Tue, 1 Aug 2017 06:38:46 -0400 Received: by mail-qk0-f174.google.com with SMTP id u139so6475966qka.1 for ; Tue, 01 Aug 2017 03:38:46 -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=YnziTXPznZwmpN60SnzCWq05LahmgEGwbYsh47/qO3TGuF9FhFT5JXNeBuM/5BaBqm spGnFn1lP371JyLizgJE9gVZ0fMfO2aAXEsFXKWGLqEg8M0RRVVwqSwxGe+8fgFzu3Hr b9DRpckqv54hhsS2B/GnyyAnDBdnsDLnglBRg= 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=RDcaR29RPiYtDVltsKaaFARXjptdkZGdWdV2LA9vFolF4pnpLAYi3AJxMtd8z4C/DM DAh25/G1Y5XiusGwk+yYgMoMiZtREEmRneWQjfwrIYZWopj7wFvEwwxOxeuTXqHKJ5hF KTe/DSZ7z0PxRYbM5W3Lg7ktycZynn+yhWWK7WTluCNkEUPXepa0mdd5S93EwKvpN5MN sLmDF8we/eN77Kuvk76FJN0NHLRDOXsNajt4Uc/mz0qxUx7dvaYB2cX92GBK/KhQHMeO mJ+MKztLcIZNQG3pMnLFDzLPc2le6M+AtyQX4DiASEw056vxiKfdziDaCBuKJ2lcCQmU 5T7Q== X-Gm-Message-State: AIVw1103GnRSomN3EzpWQpdQQt9ZrYqQ60fiKMcCzImJUYIaSLhkWkPF sZ5p58D4rNdAJ30z X-Received: by 10.55.135.132 with SMTP id j126mr11986819qkd.129.1501583925904; Tue, 01 Aug 2017 03:38:45 -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 e32sm21784162qtb.63.2017.08.01.03.38.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Aug 2017 03:38:45 -0700 (PDT) From: Anup Patel To: Rob Herring , Mark Rutland , Vinod Koul , Dan Williams Cc: Florian Fainelli , Scott Branden , Ray Jui , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Anup Patel Subject: [PATCH v2 04/16] dmaengine: bcm-sba-raid: Remove redundant next_count from sba_request Date: Tue, 1 Aug 2017 16:07:48 +0530 Message-Id: <1501583880-32072-5-git-send-email-anup.patel@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501583880-32072-1-git-send-email-anup.patel@broadcom.com> References: <1501583880-32072-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;