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: linux-netdev <netdev@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Julian Wiedmann <jwi@linux.ibm.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: [PATCH net-next 5/6] s390/ctcm: Use GFP_KERNEL in add_channel().
Date: Mon, 30 Nov 2020 11:09:49 +0100	[thread overview]
Message-ID: <20201130100950.42051-6-jwi@linux.ibm.com> (raw)
In-Reply-To: <20201130100950.42051-1-jwi@linux.ibm.com>

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

gfp_type() uses in_interrupt() to figure out the correct GFP mask.

The usage of in_interrupt() in drivers is phased out and Linus clearly
requested that code which changes behaviour depending on context should
either be separated or the context be conveyed in an argument passed by the
caller, which usually knows the context.

The memory allocation of `ch' a few lines above is using GFP_KERNEL,
also an allocation a few lines later is using GFP_KERNEL.

Use GFP_KERNEL for the memory allocation.

Reviewed-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
 drivers/s390/net/ctcm_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 92dd3c803d23..c446883de5c8 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -1321,7 +1321,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type,
 
 	ch->protocol = priv->protocol;
 	if (IS_MPC(priv)) {
-		ch->discontact_th = kzalloc(TH_HEADER_LENGTH, gfp_type());
+		ch->discontact_th = kzalloc(TH_HEADER_LENGTH, GFP_KERNEL);
 		if (ch->discontact_th == NULL)
 					goto nomem_return;
 
-- 
2.17.1


  parent reply	other threads:[~2020-11-30 10:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 10:09 [PATCH net-next 0/6] s390/ctcm: updates 2020-11-30 Julian Wiedmann
2020-11-30 10:09 ` [PATCH net-next 1/6] s390/ctcm: Avoid temporary allocation of struct th_header and th_sweep Julian Wiedmann
2020-12-02  1:02   ` Jakub Kicinski
2020-11-30 10:09 ` [PATCH net-next 2/6] s390/ctcm: Avoid temporary allocation of struct qllc Julian Wiedmann
2020-11-30 10:09 ` [PATCH net-next 3/6] s390/ctcm: Avoid temporary allocation of struct pdu Julian Wiedmann
2020-11-30 10:09 ` [PATCH net-next 4/6] s390/ctcm: Use explicit allocation mask in ctcmpc_unpack_skb() Julian Wiedmann
2020-11-30 10:09 ` Julian Wiedmann [this message]
2020-11-30 10:09 ` [PATCH net-next 6/6] s390/ctcm: Use GFP_ATOMIC in ctcmpc_tx() Julian Wiedmann
2020-12-02  1:04 ` [PATCH net-next 0/6] s390/ctcm: updates 2020-11-30 Jakub Kicinski

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=20201130100950.42051-6-jwi@linux.ibm.com \
    --to=jwi@linux.ibm.com \
    --cc=bigeasy@linutronix.de \
    --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 \
    /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).