From patchwork Fri Sep 18 12:57:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7216001 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@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 2206F9F32B for ; Fri, 18 Sep 2015 12:58:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46BFF208D1 for ; Fri, 18 Sep 2015 12:58:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E3E3208B8 for ; Fri, 18 Sep 2015 12:58:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753859AbbIRM6H (ORCPT ); Fri, 18 Sep 2015 08:58:07 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:38182 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753827AbbIRM6F (ORCPT ); Fri, 18 Sep 2015 08:58:05 -0400 Received: by wiclk2 with SMTP id lk2so29951087wic.1; Fri, 18 Sep 2015 05:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nrs/4vBM3LmuPdai54kP9GmCfk6fDn94ge+IQkiu344=; b=A4iufoPdJgygZ2Mx4JYEK1LGWP3XC6BzBsAOq4vLLGUEAujXXnU+FG8eR295FtX7gd Rmyp42DIVylo/ZuPP/s1lxthCuMCJRoN1S81504q5hB/e4NU6Qp1tmB+euR3wxHHS4SJ PpDqTQsqlRG4pBFVxzrxntJhvHLy7IJ5lJjtZER5lkIzQUzMXEppqwuC3djbG3+44Qfr xN6mhdJgxS22rAR06M8dcaLHAxew33jqq5QFbLP052sTBvg7Q5o/7HkdMOE6Zmduy8CZ FfQ+Jp7AeQvK7BHJiryVQCdAbuxA2DR+COd97Rb+UV4F7wfulPW7EqJvxkzizWmw4o0j xfSQ== X-Received: by 10.194.172.233 with SMTP id bf9mr7116997wjc.107.1442581083970; Fri, 18 Sep 2015 05:58:03 -0700 (PDT) Received: from Red.local (ANice-651-1-293-37.w83-201.abo.wanadoo.fr. [83.201.193.37]) by smtp.googlemail.com with ESMTPSA id kb5sm8789638wjc.17.2015.09.18.05.58.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 05:58:03 -0700 (PDT) From: LABBE Corentin To: herbert@gondor.apana.org.au, davem@davemloft.net, heiko.carstens@de.ibm.com, maier@linux.vnet.ibm.com, schwidefsky@de.ibm.com Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, LABBE Corentin , linux-s390@vger.kernel.org Subject: [PATCH v2 4/8] s390: replace zfcp_qdio_sbale_count by sg_nents Date: Fri, 18 Sep 2015 14:57:12 +0200 Message-Id: <1442581036-23789-5-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1442581036-23789-1-git-send-email-clabbe.montjoie@gmail.com> References: <1442581036-23789-1-git-send-email-clabbe.montjoie@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 The zfcp_qdio_sbale_count function do the same work than sg_nents(). So replace it by sg_nents() for removing duplicate code. Signed-off-by: LABBE Corentin --- drivers/s390/scsi/zfcp_fsf.c | 3 +-- drivers/s390/scsi/zfcp_qdio.h | 15 --------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 522a633..edc137a 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -985,8 +985,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, if (zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, sg_resp)) return -EIO; - zfcp_qdio_set_data_div(qdio, &req->qdio_req, - zfcp_qdio_sbale_count(sg_req)); + zfcp_qdio_set_data_div(qdio, &req->qdio_req, sg_nents(sg_req)); zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); zfcp_qdio_set_scount(qdio, &req->qdio_req); return 0; diff --git a/drivers/s390/scsi/zfcp_qdio.h b/drivers/s390/scsi/zfcp_qdio.h index 497cd37..85cdb82 100644 --- a/drivers/s390/scsi/zfcp_qdio.h +++ b/drivers/s390/scsi/zfcp_qdio.h @@ -225,21 +225,6 @@ void zfcp_qdio_set_data_div(struct zfcp_qdio *qdio, } /** - * zfcp_qdio_sbale_count - count sbale used - * @sg: pointer to struct scatterlist - */ -static inline -unsigned int zfcp_qdio_sbale_count(struct scatterlist *sg) -{ - unsigned int count = 0; - - for (; sg; sg = sg_next(sg)) - count++; - - return count; -} - -/** * zfcp_qdio_real_bytes - count bytes used * @sg: pointer to struct scatterlist */