diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-08-29 09:30:41 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-08-29 09:31:47 +0200 | 
| commit | eebc57f73d42095b778e899f6aa90ad050c72655 (patch) | |
| tree | 2ba80c75e9284093e6d7606dbb1b6a4bb752a2a5 /lib/dma-debug.c | |
| parent | d3a247bfb2c26f5b67367d58af7ad8c2efbbc6c1 (diff) | |
| parent | 2a4ab640d3c28c2952967e5f63ea495555bf2a5f (diff) | |
Merge branch 'for-ingo' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-sfi-2.6 into x86/apic
Merge reason: the SFI (Simple Firmware Interface) feature in the ACPI
              tree needs this cleanup, pull it into the APIC branch as
	      well so that there's no interactions.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib/dma-debug.c')
| -rw-r--r-- | lib/dma-debug.c | 28 | 
1 files changed, 16 insertions, 12 deletions
| diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 65b0d99b6d0a..58a9f9fc609a 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -156,9 +156,13 @@ static bool driver_filter(struct device *dev)  		return true;  	/* driver filter on and initialized */ -	if (current_driver && dev->driver == current_driver) +	if (current_driver && dev && dev->driver == current_driver)  		return true; +	/* driver filter on, but we can't filter on a NULL device... */ +	if (!dev) +		return false; +  	if (current_driver || !current_driver_name[0])  		return false; @@ -183,17 +187,17 @@ static bool driver_filter(struct device *dev)  	return ret;  } -#define err_printk(dev, entry, format, arg...) do {		\ -		error_count += 1;				\ -		if (driver_filter(dev) &&			\ -		    (show_all_errors || show_num_errors > 0)) {	\ -			WARN(1, "%s %s: " format,		\ -			     dev_driver_string(dev),		\ -			     dev_name(dev) , ## arg);		\ -			dump_entry_trace(entry);		\ -		}						\ -		if (!show_all_errors && show_num_errors > 0)	\ -			show_num_errors -= 1;			\ +#define err_printk(dev, entry, format, arg...) do {			\ +		error_count += 1;					\ +		if (driver_filter(dev) &&				\ +		    (show_all_errors || show_num_errors > 0)) {		\ +			WARN(1, "%s %s: " format,			\ +			     dev ? dev_driver_string(dev) : "NULL",	\ +			     dev ? dev_name(dev) : "NULL", ## arg);	\ +			dump_entry_trace(entry);			\ +		}							\ +		if (!show_all_errors && show_num_errors > 0)		\ +			show_num_errors -= 1;				\  	} while (0);  /* | 
