Re: [PATCH v1 1/7] extcon: Make static analyzer happy about union assignment
Hi, On 2018년 08월 28일 00:35, Andy Shevchenko wrote: > When assign unions we need to supply non-scalar value, otherwise > static analyzer is not happy: > > CHECK drivers/extcon/extcon.c > drivers/extcon/extcon.c:631:22: warning: cast to non-scalar > > Signed-off-by: Andy Shevchenko > --- > drivers/extcon/extcon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c > index b9d27c8fe57e..c21650a92689 100644 > --- a/drivers/extcon/extcon.c > +++ b/drivers/extcon/extcon.c > @@ -628,7 +628,7 @@ int extcon_get_property(struct extcon_dev *edev, unsigned > int id, > unsigned long flags; > int index, ret = 0; > > - *prop_val = (union extcon_property_value)(0); > + *prop_val = (union extcon_property_value){0}; > > if (!edev) > return -EINVAL; > Applied all patches of this series. Thanks. -- Best Regards, Chanwoo Choi Samsung Electronics
Re: [PATCH v1 1/7] extcon: Make static analyzer happy about union assignment
Hi, On 2018년 08월 28일 00:35, Andy Shevchenko wrote: > When assign unions we need to supply non-scalar value, otherwise > static analyzer is not happy: > > CHECK drivers/extcon/extcon.c > drivers/extcon/extcon.c:631:22: warning: cast to non-scalar > > Signed-off-by: Andy Shevchenko > --- > drivers/extcon/extcon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c > index b9d27c8fe57e..c21650a92689 100644 > --- a/drivers/extcon/extcon.c > +++ b/drivers/extcon/extcon.c > @@ -628,7 +628,7 @@ int extcon_get_property(struct extcon_dev *edev, unsigned > int id, > unsigned long flags; > int index, ret = 0; > > - *prop_val = (union extcon_property_value)(0); > + *prop_val = (union extcon_property_value){0}; > > if (!edev) > return -EINVAL; > Applied all patches of this series. Thanks. -- Best Regards, Chanwoo Choi Samsung Electronics
[PATCH v1 1/7] extcon: Make static analyzer happy about union assignment
When assign unions we need to supply non-scalar value, otherwise static analyzer is not happy: CHECK drivers/extcon/extcon.c drivers/extcon/extcon.c:631:22: warning: cast to non-scalar Signed-off-by: Andy Shevchenko --- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index b9d27c8fe57e..c21650a92689 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -628,7 +628,7 @@ int extcon_get_property(struct extcon_dev *edev, unsigned int id, unsigned long flags; int index, ret = 0; - *prop_val = (union extcon_property_value)(0); + *prop_val = (union extcon_property_value){0}; if (!edev) return -EINVAL; -- 2.18.0
[PATCH v1 1/7] extcon: Make static analyzer happy about union assignment
When assign unions we need to supply non-scalar value, otherwise static analyzer is not happy: CHECK drivers/extcon/extcon.c drivers/extcon/extcon.c:631:22: warning: cast to non-scalar Signed-off-by: Andy Shevchenko --- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index b9d27c8fe57e..c21650a92689 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -628,7 +628,7 @@ int extcon_get_property(struct extcon_dev *edev, unsigned int id, unsigned long flags; int index, ret = 0; - *prop_val = (union extcon_property_value)(0); + *prop_val = (union extcon_property_value){0}; if (!edev) return -EINVAL; -- 2.18.0