Message ID | 20200922155100.1624976-1-awogbemila@google.com |
---|---|
Headers | show |
Series | GVE Raw Addressing | expand |
On Tue, 22 Sep 2020 08:50:58 -0700 David Awogbemila wrote: > + dev_opt = (struct gve_device_option *)((void *)descriptor + > + sizeof(*descriptor)); You don't need to cast void pointers to types. The idiomatic way to get end of structure in C is: &descriptor[1] or descriptor + 1.
On Tue, 22 Sep 2020 08:51:00 -0700 David Awogbemila wrote: > -static void gve_dma_sync_for_device(struct device *dev, dma_addr_t *page_buses, > - u64 iov_offset, u64 iov_len) > +static void gve_dma_sync_for_device(struct gve_priv *priv, > + dma_addr_t *page_buses, > + u64 iov_offset, u64 iov_len) Alignment stilled messed up here.
On Tue, Sep 22, 2020 at 10:32 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Tue, 22 Sep 2020 08:50:58 -0700 David Awogbemila wrote: > > + dev_opt = (struct gve_device_option *)((void *)descriptor + > > + sizeof(*descriptor)); > > You don't need to cast void pointers to types. > > The idiomatic way to get end of structure in C is: &descriptor[1] or > descriptor + 1. Ok, I'll adjust this, thanks.
On Tue, Sep 22, 2020 at 10:40 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Tue, 22 Sep 2020 08:51:00 -0700 David Awogbemila wrote: > > -static void gve_dma_sync_for_device(struct device *dev, dma_addr_t *page_buses, > > - u64 iov_offset, u64 iov_len) > > +static void gve_dma_sync_for_device(struct gve_priv *priv, > > + dma_addr_t *page_buses, > > + u64 iov_offset, u64 iov_len) > > Alignment stilled messed up here. Thanks, I'll fix this.