mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	net: hostap: Remove in_interrupt() usage
in_interrupt() is ill defined and does not provide what the name suggests. The usage especially in driver code is deprecated and a tree wide effort to clean up and consolidate the (ab)usage of in_interrupt() and related checks is happening. hfa384x_cmd() and prism2_hw_reset() check in_interrupt() at function entry and if true emit a printk at debug loglevel and return. This is clearly debug code. Both functions invoke functions which can sleep. These functions already have appropriate debug checks which cover all invalid contexts, while in_interrupt() fails to detect context which just has preemption or interrupts disabled. Remove both checks as they are incomplete, debug only and already covered by the subsequently invoked functions properly. If called from invalid context the resulting back trace is definitely more helpful to analyze the problem than a printk at debug loglevel. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									bd63bca5e0
								
							
						
					
					
						commit
						75fd296398
					
				
					 1 changed files with 0 additions and 12 deletions
				
			
		|  | @ -320,12 +320,6 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0, | |||
| 	iface = netdev_priv(dev); | ||||
| 	local = iface->local; | ||||
| 
 | ||||
| 	if (in_interrupt()) { | ||||
| 		printk(KERN_DEBUG "%s: hfa384x_cmd called from interrupt " | ||||
| 		       "context\n", dev->name); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	if (local->cmd_queue_len >= HOSTAP_CMD_QUEUE_MAX_LEN) { | ||||
| 		printk(KERN_DEBUG "%s: hfa384x_cmd: cmd_queue full\n", | ||||
| 		       dev->name); | ||||
|  | @ -1560,12 +1554,6 @@ static void prism2_hw_reset(struct net_device *dev) | |||
| 	iface = netdev_priv(dev); | ||||
| 	local = iface->local; | ||||
| 
 | ||||
| 	if (in_interrupt()) { | ||||
| 		printk(KERN_DEBUG "%s: driver bug - prism2_hw_reset() called " | ||||
| 		       "in interrupt context\n", dev->name); | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	if (local->hw_downloading) | ||||
| 		return; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Sebastian Andrzej Siewior
						Sebastian Andrzej Siewior