Re: [PATCH] staging: comedi: remove __user annotation inside of struct's

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

 



On Wed, May 09, 2012 at 12:01:25PM +0100, Ian Abbott wrote:
> Are there any handy macros for casting pointers to __user pointers,
> something like
> 
> #define _user(p) ((typeof(*(p)) __user *)(p))
> 
> but preferably without the repeated expansion of 'p' in case of
> side-effects?

typeof() doesn't have side effects.

#include <stdio.h>

int main(void)
{
	int x = 0;
	typeof(x++) y;

	printf("%d\n", x);

	return 0;
}

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux