Re: [PATCH v1 1/4] drm/mga: drop dependency on drm_os_linux.h

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

 



Hi

Am 11.06.19 um 12:44 schrieb Sam Ravnborg:
> Hi Thomas.
> 
>>> +#define MGA_READ8(reg) \
>>> +	readb(((void __iomem *)dev_priv->mmio->handle) + (reg))
>>> +#define MGA_READ(reg) \
>>> +	readl(((void __iomem *)dev_priv->mmio->handle) + (reg))
>>> +#define MGA_WRITE8(reg, val) \
>>> +	writeb(val, ((void __iomem *)dev_priv->mmio->handle) + (reg))
>>> +#define MGA_WRITE(reg, val) \
>>> +	writel(val, ((void __iomem *)dev_priv->mmio->handle) + (reg))
>>
>> Addition is not defined or implementation specific for type void* IIRC.
>> Compilers tend to treat it like u8*. Maybe cast mmio->handle to (u8
>> __iomem *) instead?
> I briefly looked at changing the type of mmio->handle
> 
> Today:
> 
> 	void *handle;            /**< User-space: "Handle" to pass to mmap() */
> 
> Proposal:
> 	void __iomem *handle;            /**< User-space: "Handle" to pass to mmap() */
> 
> This would allow me to drop the cast in the code above, that is only
> added to make sparse happy.
> But the above triggered other sparse warnings and I ended up dropping
> this.
> 
> As for (void *) versus (u8 *), then (void *) is what we do today.
> [What Daniel also says in another mail].
> 
> Should we change the type I would prepfer a follow-up patch to do it.
> 
> If you could test it I can type the patch, or you could do so when
> working with the driver.

I don't really do anything with mga, so my testing is as good as
anyone's. But it's not that important. Don't make this patch set depend
on such mostly cosmetic issues.

Best regards
Thomas


> 
> 	Sam
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux