lkml.org 
[lkml]   [2019]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] i2c: mux: pinctrl: use flexible-array member and struct_size() helper
Date
On 2019-06-03 16:53, Gustavo A. R. Silva wrote:
> Update the code to use a flexible array member instead of a pointer in
> structure i2c_mux_pinctrl and use the struct_size() helper.
>
> Also, make use of the struct_size() helper instead of an open-coded
> version in order to avoid any potential type mistakes, in particular
> in the context in which this code is being used.
>
> So, replace the following form:
>
> sizeof(*mux) + num_names * sizeof(*mux->states)
>
> with:
>
> struct_size(mux, states, num_names)
>
> This code was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Thanks, patch applied to i2c-mux/for-next

Cheers,
Peter


\
 
 \ /
  Last update: 2019-06-11 09:21    [W:0.030 / U:1.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site