netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Ursula Braun <ubraun@linux.ibm.com>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 07/10] s390/qeth: clean up a magic number in the OAT callback
Date: Tue, 14 Jul 2020 16:23:02 +0200	[thread overview]
Message-ID: <20200714142305.29297-8-jwi@linux.ibm.com> (raw)
In-Reply-To: <20200714142305.29297-1-jwi@linux.ibm.com>

Use the correct struct member instead of hardcoding its offset.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
 drivers/s390/net/qeth_core_main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 31fa9ffc7cf4..c5ff7edb4ba1 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -4839,7 +4839,6 @@ static int qeth_setadpparms_query_oat_cb(struct qeth_card *card,
 {
 	struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *)data;
 	struct qeth_qoat_priv *priv;
-	char *resdata;
 	int resdatalen;
 
 	QETH_CARD_TEXT(card, 3, "qoatcb");
@@ -4848,13 +4847,12 @@ static int qeth_setadpparms_query_oat_cb(struct qeth_card *card,
 
 	priv = (struct qeth_qoat_priv *)reply->param;
 	resdatalen = cmd->data.setadapterparms.hdr.cmdlength;
-	resdata = (char *)data + 28;
 
 	if (resdatalen > (priv->buffer_len - priv->response_len))
 		return -ENOSPC;
 
-	memcpy((priv->buffer + priv->response_len), resdata,
-		resdatalen);
+	memcpy(priv->buffer + priv->response_len,
+	       &cmd->data.setadapterparms.hdr, resdatalen);
 	priv->response_len += resdatalen;
 
 	if (cmd->data.setadapterparms.hdr.seq_no <
-- 
2.17.1


  parent reply	other threads:[~2020-07-14 14:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 14:22 [PATCH net-next 00/10] s390/qeth: updates 2020-07-14 Julian Wiedmann
2020-07-14 14:22 ` [PATCH net-next 01/10] s390/qeth: reject unsupported link type earlier Julian Wiedmann
2020-07-14 14:22 ` [PATCH net-next 02/10] s390/qeth: fine-tune errno when cmds are cancelled Julian Wiedmann
2020-07-14 14:22 ` [PATCH net-next 03/10] s390/qeth: only init the isolation mode when necessary Julian Wiedmann
2020-07-14 14:22 ` [PATCH net-next 04/10] s390/qeth: don't clear the configured isolation mode Julian Wiedmann
2020-07-14 14:23 ` [PATCH net-next 05/10] s390/qeth: clean up error handling for isolation mode cmds Julian Wiedmann
2020-07-14 14:23 ` [PATCH net-next 06/10] s390/qeth: use u64_to_user_ptr() in the OAT code Julian Wiedmann
2020-07-14 14:23 ` Julian Wiedmann [this message]
2020-07-14 14:23 ` [PATCH net-next 08/10] s390/qeth: cleanup " Julian Wiedmann
2020-07-14 14:23 ` [PATCH net-next 09/10] s390/qeth: unify RX-mode hashtables Julian Wiedmann
2020-07-14 14:23 ` [PATCH net-next 10/10] s390/qeth: constify the MPC initialization data Julian Wiedmann
2020-07-14 21:54 ` [PATCH net-next 00/10] s390/qeth: updates 2020-07-14 David Miller

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=20200714142305.29297-8-jwi@linux.ibm.com \
    --to=jwi@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=hca@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ubraun@linux.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;
as well as URLs for NNTP newsgroup(s).