lkml.org 
[lkml]   [2013]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sound/pci/asihpi/hpioctl.c:125:6: warning: cast to pointer from integer of different size
On Fri, Feb 08, 2013 at 08:50:57PM +0200, Ville Syrjälä wrote:
> struct {
> uint8_t sika1;
> uint16_t sika2;
> uint32_t sika4;
> uint64_t sika8;

Note - you also need to check what the behaviour is with a pointer type
too - that's the one that gets ARM if you try this. My test set on ARM
was:

int test_8(unsigned char *v, unsigned char *p)
{
return get_user(*v, p);
}

int test_16(unsigned short *v, unsigned short *p)
{
return get_user(*v, p);
}

int test_32(unsigned int *v, unsigned int *p)
{
return get_user(*v, p);
}

int test_32_constp(unsigned int *v, const unsigned int *p)
{
return get_user(*v, p);
}

int test_64(unsigned long long *v, unsigned long long *p)
{
return get_user(*v, p);
}

int test_64_narrow(unsigned long *v, unsigned long long *p)
{
return get_user(*v, p);
}

int test_ptr(unsigned int **v, unsigned int **p)
{
return get_user(*v, p);
}

int test_wrong(char **v, const char **p)
{
return get_user(*v, p);
}

All but the last should build cleanly and correctly. The last should
issue a warning.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-02-09 00:41    [W:0.064 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site