Re: [PATCH 2/2] video: clps711x: Fix sparse warnings

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

 



Tue, 1 Jul 2014 13:22:51 +0300 от Tomi Valkeinen <tomi.valkeinen@xxxxxx>:
> On 01/07/14 09:23, Alexander Shiyan wrote:
> > Tue, 1 Jul 2014 09:14:02 +0300 от Tomi Valkeinen <tomi.valkeinen@xxxxxx>:
> >> On 28/06/14 09:34, Alexander Shiyan wrote:
> >>> This patch fixes below warnings:
> >>> CHECK   drivers/video/fbdev/clps711x-fb.c
> >>>   drivers/video/fbdev/clps711x-fb.c:247:24: warning: incorrect type in argument 1 (different address spaces)
> >>>   drivers/video/fbdev/clps711x-fb.c:247:24:    expected void const *ptr
> >>>   drivers/video/fbdev/clps711x-fb.c:247:24:    got char [noderef] <asn:2>*screen_base
> >>>   drivers/video/fbdev/clps711x-fb.c:248:35: warning: incorrect type in argument 1 (different address spaces)
> >>>   drivers/video/fbdev/clps711x-fb.c:248:35:    expected void const *ptr
> >>>   drivers/video/fbdev/clps711x-fb.c:248:35:    got char [noderef] <asn:2>*screen_base
> > ...
> >>>  	info->screen_base = devm_ioremap_resource(dev, res);
> >>> -	if (IS_ERR(info->screen_base)) {
> >>> -		ret = PTR_ERR(info->screen_base);
> >>> +	if (IS_ERR((__force void *)info->screen_base)) {
> >>> +		ret = PTR_ERR((__force void *)info->screen_base);
> >>
> >> I don't see any other user of devm_ioremap_resource() having that kind
> >> of casts. Why are they needed here?
> > 
> > Not needed, type cast was done only to remove sparse warnings.
> 
> Right, but I think either sparse is wrong here, or the PTR_ERR/IS_ERR
> are wrong. You shouldn't do typecasts like that to hide those warnings.

Well, I'll remove these changes and send a second version of the patch.

---

��.n��������+%������w��{.n�����{����n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�


[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux