Re: [PATCH 4/5] mm, slob: Use only 'ret' variable for both slob object and returned pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 5 Sep 2012, Ezequiel Garcia wrote:

> There's no need to use two variables, 'ret' and 'm'.
> This is a minor cleanup patch, but it will allow next patch to clean
> the way tracing is done.

The compiler will fold those variables into one if possible. No need to
worry about having multiple declarations.

>  		if (!size)
>  			return ZERO_SIZE_PTR;
>
> -		m = slob_alloc(size + align, gfp, align, node);
> +		ret = slob_alloc(size + align, gfp, align, node);
>
> -		if (!m)
> +		if (!ret)
>  			return NULL;
> -		*m = size;
> -		ret = (void *)m + align;
> +		*(unsigned int *)ret = size;

An ugly cast...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]