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 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.

	Sam
_______________________________________________
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