From patchwork Fri Oct 13 12:46:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 10004537 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 D3F9060216 for ; Fri, 13 Oct 2017 12:53:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6D2629002 for ; Fri, 13 Oct 2017 12:53:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBD082905C; Fri, 13 Oct 2017 12:53:33 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 776A429002 for ; Fri, 13 Oct 2017 12:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758431AbdJMMxc (ORCPT ); Fri, 13 Oct 2017 08:53:32 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55989 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932126AbdJMMrt (ORCPT ); Fri, 13 Oct 2017 08:47:49 -0400 Received: by mail-wm0-f67.google.com with SMTP id u138so21646305wmu.4 for ; Fri, 13 Oct 2017 05:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q4HQqIvfvxHeg7dRKNBZ1mJA0/uc8V8EqTQtdqOlyEg=; b=BBzBFWc3ykGNc+0/kB7yZ7UXs+MpK6a1AXZfo+fYhssX3ytoj14M64tofgDiNUalsn h2EScAwL7sbiRjvo/ToitDUyLRM9+rBWbJrnPh3V/vQ5pDaPAVZES0UsfkIbpcxwrhW3 CSm1qLuKHZ5iG6k/4TH8sNfDkjHnpt52xS2kk= 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=Q4HQqIvfvxHeg7dRKNBZ1mJA0/uc8V8EqTQtdqOlyEg=; b=UHlz9jOLxcd+KNYh6isqwT+8aWCSOHiQcgUWFr8ykFNdsW7s1CJgSGsXocZfizUFL6 qZ0H5PFn7P/noJBSl2LHR7iulvFcjmgViOVxrkwLIAuTp8XFxDhbjY3Vu7PhcxLhlKhD wkcQvMV/MiD1dDuTdOztBQPhoBbkiXcV36wW4QrpsHfO4diDn0I+KLRyOTFcZAdMuLUt W7jMa3aOkl1KSjtX8EQKS4EQZnt1+vlIb2pWaZcMBsh4cXz2gpYTLDTwdk9NJfxvWoSP ZcN9uoP09CKMeibcAxLqg39AqpdHYHO1MXgTdXpfu2R0YUleDvCgvl3VFOiImRDepKXn AzFA== X-Gm-Message-State: AMCzsaW9C7bhbxmHNv8aoJ0Qha9XFfQb0F0X3YiZWrorp8QbgTBp8UxD FWfr7ZJwiiCRWtpERb1Ra28X3g== X-Google-Smtp-Source: AOwi7QC3mZ+DBM5b9x3DwWIb1uQyAam3uFRN+Nu0CxA4Ft6gfXymYUW5Ehb+HZxK63peKJ8KGB5UWg== X-Received: by 10.80.151.228 with SMTP id f33mr2075556edb.20.1507898868053; Fri, 13 Oct 2017 05:47:48 -0700 (PDT) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id p91sm735012edp.69.2017.10.13.05.47.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 05:47:47 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Rakesh Pandit , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 43/58] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p Date: Fri, 13 Oct 2017 14:46:32 +0200 Message-Id: <20171013124647.32668-44-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171013124647.32668-1-m@bjorling.me> References: <20171013124647.32668-1-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rakesh Pandit We already pass the structure pointer so no need to pass the member. Signed-off-by: Rakesh Pandit Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-rb.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c index 1173e23..b8f78e4 100644 --- a/drivers/lightnvm/pblk-rb.c +++ b/drivers/lightnvm/pblk-rb.c @@ -201,8 +201,7 @@ unsigned int pblk_rb_read_commit(struct pblk_rb *rb, unsigned int nr_entries) return subm; } -static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int *l2p_upd, - unsigned int to_update) +static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int to_update) { struct pblk *pblk = container_of(rb, struct pblk, rwb); struct pblk_line *line; @@ -213,7 +212,7 @@ static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int *l2p_upd, int flags; for (i = 0; i < to_update; i++) { - entry = &rb->entries[*l2p_upd]; + entry = &rb->entries[rb->l2p_update]; w_ctx = &entry->w_ctx; flags = READ_ONCE(entry->w_ctx.flags); @@ -230,7 +229,7 @@ static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int *l2p_upd, line = &pblk->lines[pblk_tgt_ppa_to_line(w_ctx->ppa)]; kref_put(&line->ref, pblk_line_put); clean_wctx(w_ctx); - *l2p_upd = (*l2p_upd + 1) & (rb->nr_entries - 1); + rb->l2p_update = (rb->l2p_update + 1) & (rb->nr_entries - 1); } pblk_rl_out(&pblk->rl, user_io, gc_io); @@ -258,7 +257,7 @@ static int pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int nr_entries, count = nr_entries - space; /* l2p_update used exclusively under rb->w_lock */ - ret = __pblk_rb_update_l2p(rb, &rb->l2p_update, count); + ret = __pblk_rb_update_l2p(rb, count); out: return ret; @@ -280,7 +279,7 @@ void pblk_rb_sync_l2p(struct pblk_rb *rb) sync = smp_load_acquire(&rb->sync); to_update = pblk_rb_ring_count(sync, rb->l2p_update, rb->nr_entries); - __pblk_rb_update_l2p(rb, &rb->l2p_update, to_update); + __pblk_rb_update_l2p(rb, to_update); spin_unlock(&rb->w_lock); }