ioport: Use kzalloc() instead of kmalloc()/memset() in _sparc_alloc_io()
PATCH 1/1 ioport: Use kzalloc() instead of kmalloc()/memset() in _sparc_alloc_io()
Replace kmalloc+memset by kzalloc for better readability and simplicity. This addresses the warning below:
WARNING: kzalloc should be used for data, instead of kmalloc/memset
Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by longlong yan <[email protected]>
--- arch/sparc/kernel/ioport.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/sparc/kernel/ioport.c +1 -2
@@ -184,9 +184,8 @@ static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys, printed_full =1 ; } tlen =strlen (name); - tack =kmalloc (sizeof (struct resource ) + tlen +1 ,GFP_KERNEL ); + tack =kzalloc (sizeof (struct resource ) + tlen +1 ,GFP_KERNEL );if (tack ==NULL )return NULL ; -memset (tack,0 ,sizeof (struct resource )); res = (struct resource *) tack; tack +=sizeof (struct resource ); }
Signature · 1 line
2.43.0