On 2016-08-22 at 20:44 ron minnich wrote:
> > i'd be happy to merge this, though my slight concern is that these
> > helpers were linux code, and there might have been a reason it was the
> > way it was. (like painful casting, or something, in a lot of driver
> > code).
> >
>
> They usually do that when they're going to put them in some struct
> somewhere, which we don't have. I'd rather leave it type safe here and cast
> it in the struct initializer, after having been hurt by this.
i tried the patch out and i get build errors like this:
kern/drivers/net/mlx4/main.c: In function 'mlx4_reset_vf_support':
kern/drivers/net/mlx4/main.c:1753:28: error: passing argument 1 of 'read32'
from incompatible pointer type [-Werror]
comm_caps = swab32(read32((__iomem char *)priv->mfunc.comm +
^
In file included from
/home/brho/classes/ros/ros-kernel/kern/include/linux_compat.h:24:0,
from kern/drivers/net/mlx4/main.c:36:
/home/brho/classes/ros/ros-kernel/kern/include/mmio.h:88:24: note: expected
'const volatile uint32_t *' but argument is of type 'char *'
static inline uint32_t read32(const volatile uint32_t __iomem *addr)
i'm worried about shit like that in general.
anyway, i changed mlx4 to cast to an __iomem u32*. if it becomes a
problem later on, then we can deal with it later. (i didn't test the
driver btw, just built).
> > > -static inline uint8_t __raw_read8(const volatile void __iomem *addr)
> > > +static inline uint8_t __raw_read8(const volatile uint8_t __iomem *addr)
> > {
> > > return *(const volatile uint8_t __force *)addr;
> >
> > Do these still need the cast, since they now take a const vol u8 *?
> >
>
> yeah, because we might someday want __iomem and __force.
cool, sounds good.
Merged to master at 86109dc44d5a..c635ff1ff38b (from, to]
You can see the entire diff with 'git diff' or at
https://github.com/brho/akaros/compare/86109dc44d5a...c635ff1ff38b
--
You received this message because you are subscribed to the Google Groups
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.