Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/ctcm: Use GFP_ATOMIC in ctcmpc_tx().

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.

ctcmpc_tx() is used as net_device_ops::ndo_start_xmit. This callback is
invoked with disabled bottom halves.

Use GFP_ATOMIC for memory allocation in ctcmpc_tx().
Remove gfp_type() since the last user is gone.

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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Sebastian Andrzej Siewior and committed by
Jakub Kicinski
8f4b6e35 04e4e469

+1 -6
+1 -1
drivers/s390/net/ctcm_main.c
··· 903 903 CTCM_D3_DUMP((char *)skb->data, min_t(int, 32, skb->len)); 904 904 905 905 len = skb->len + TH_HEADER_LENGTH + PDU_HEADER_LENGTH; 906 - newskb = __dev_alloc_skb(len, gfp_type() | GFP_DMA); 906 + newskb = __dev_alloc_skb(len, GFP_ATOMIC | GFP_DMA); 907 907 908 908 if (!newskb) { 909 909 CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_ERROR,
-5
drivers/s390/net/ctcm_main.h
··· 298 298 /* test if struct ctcm_priv of struct net_device has MPC protocol setting */ 299 299 #define IS_MPCDEV(dev) IS_MPC((struct ctcm_priv *)dev->ml_priv) 300 300 301 - static inline gfp_t gfp_type(void) 302 - { 303 - return in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; 304 - } 305 - 306 301 /* 307 302 * Definition of our link level header. 308 303 */