[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200922103226.1e8b90e8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 22 Sep 2020 10:32:26 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: David Awogbemila <awogbemila@...gle.com>
Cc: netdev@...r.kernel.org, Catherine Sullivan <csully@...gle.com>,
Yangchun Fu <yangchun@...gle.com>
Subject: Re: [PATCH net-next v2 1/3] gve: Add support for raw addressing
device option
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.
Powered by blists - more mailing lists