From: Benjamin Block <bblock@linux.vnet.ibm.com>
To: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: LABBE Corentin <clabbe.montjoie@gmail.com>,
Steffen Maier <maier@linux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
Benjamin Block <bblock@linux.vnet.ibm.com>
Subject: [PATCH 01/22] zfcp: replace zfcp_qdio_sbale_count by sg_nents
Date: Fri, 28 Jul 2017 12:30:47 +0200 [thread overview]
Message-ID: <40f8ed99ea59fb87b9a434867527c2a3ec290d4f.1501085249.git.bblock@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1501085249.git.bblock@linux.vnet.ibm.com>
In-Reply-To: <cover.1501085249.git.bblock@linux.vnet.ibm.com>
From: LABBE Corentin <clabbe.montjoie@gmail.com>
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 <clabbe.montjoie@gmail.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.vnet.ibm.com>
---
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 27ff38f839fc..3b69ec5e69ed 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -991,8 +991,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
qtcb->bottom.support.resp_buf_length =
zfcp_qdio_real_bytes(sg_resp);
- 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 497cd379b0d1..85cdb82127e8 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
*/
--
2.11.2
next prev parent reply other threads:[~2017-07-28 10:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 10:30 [PATCH 00/22] zfcp fixes and cleanups Benjamin Block
2017-07-28 10:30 ` Benjamin Block [this message]
2017-07-28 10:30 ` [PATCH 02/22] zfcp: use setup_timer instead of init_timer Benjamin Block
2017-07-28 10:30 ` [PATCH 03/22] zfcp: Remove unneeded linux/miscdevice.h include Benjamin Block
2017-07-28 10:30 ` [PATCH 04/22] zfcp: convert bool-definitions to use 'true' instead of '1' Benjamin Block
2017-07-28 10:30 ` [PATCH 05/22] zfcp: fix queuecommand for scsi_eh commands when DIX enabled Benjamin Block
2017-07-28 10:30 ` [PATCH 06/22] zfcp: add handling for FCP_RESID_OVER to the fcp ingress path Benjamin Block
2017-07-28 10:30 ` [PATCH 07/22] zfcp: fix capping of unsuccessful GPN_FT SAN response trace records Benjamin Block
2017-07-28 10:30 ` [PATCH 08/22] zfcp: fix passing fsf_req to SCSI trace on TMF to correlate with HBA Benjamin Block
2017-07-28 10:30 ` [PATCH 09/22] zfcp: fix missing trace records for early returns in TMF eh handlers Benjamin Block
2017-07-28 10:30 ` [PATCH 10/22] zfcp: fix payload with full FCP_RSP IU in SCSI trace records Benjamin Block
2017-07-28 10:30 ` [PATCH 11/22] zfcp: trace HBA FSF response by default on dismiss or timedout late response Benjamin Block
2017-07-28 10:30 ` [PATCH 12/22] zfcp: trace high part of "new" 64 bit SCSI LUN Benjamin Block
2017-07-28 10:30 ` [PATCH 13/22] zfcp: more fitting constant for fc_ct_hdr.ct_reason on port scan response Benjamin Block
2017-07-28 10:31 ` [PATCH 14/22] zfcp: clarify that we don't need "link" test on failed open port Benjamin Block
2017-07-28 10:31 ` [PATCH 15/22] zfcp: use common code fcp_cmnd and fcp_resp with union in fsf_qtcb_bottom_io Benjamin Block
2017-07-28 10:31 ` [PATCH 16/22] zfcp: use endianness conversions with common FC(P) struct fields Benjamin Block
2017-07-28 10:31 ` [PATCH 17/22] zfcp: fix kernel doc comment typos for struct zfcp_dbf_scsi Benjamin Block
2017-07-28 10:31 ` [PATCH 18/22] zfcp: clean up redundant code with fall through in link down SRB switch case Benjamin Block
2017-07-28 10:31 ` [PATCH 19/22] zfcp: clean up no longer existent prototype from zfcp API header Benjamin Block
2017-07-28 10:31 ` [PATCH 20/22] zfcp: clean up a member of struct zfcp_qdio that was assigned but never used Benjamin Block
2017-07-28 10:31 ` [PATCH 21/22] zfcp: clean up unnecessary module_param_named() with no_auto_port_rescan Benjamin Block
2017-07-28 10:31 ` [PATCH 22/22] zfcp: early returns for traces disabled via level Benjamin Block
2017-08-07 17:19 ` [PATCH 00/22] zfcp fixes and cleanups Martin K. Petersen
2017-08-08 10:02 ` Benjamin Block
2017-08-08 16:07 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40f8ed99ea59fb87b9a434867527c2a3ec290d4f.1501085249.git.bblock@linux.vnet.ibm.com \
--to=bblock@linux.vnet.ibm.com \
--cc=clabbe.montjoie@gmail.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=maier@linux.vnet.ibm.com \
--cc=martin.petersen@oracle.com \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox