lkml.org 
[lkml]   [2023]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 7/8] net: microchip: sparx5: Add support for IS0 VCAP ethernet protocol types
On Fri, Jan 20, 2023 at 10:08:30AM +0100, Steen Hegelund wrote:
> +bool sparx5_vcap_is_known_etype(struct vcap_admin *admin, u16 etype)
> +{
> + const u16 *known_etypes;
> + int size, idx;
> +
> + switch (admin->vtype) {
> + case VCAP_TYPE_IS0:
> + known_etypes = sparx5_vcap_is0_known_etypes;
> + size = ARRAY_SIZE(sparx5_vcap_is0_known_etypes);
> + break;
> + case VCAP_TYPE_IS2:
> + known_etypes = sparx5_vcap_is2_known_etypes;
> + size = ARRAY_SIZE(sparx5_vcap_is2_known_etypes);
> + break;
> + default:
> + break;

return false; to avoid an uninitialized "size".

> + }
> + for (idx = 0; idx < size; ++idx)
> + if (known_etypes[idx] == etype)
> + return true;
> + return false;
> +}

regards,
dan carpenter

\
 
 \ /
  Last update: 2023-03-26 23:49    [W:0.107 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site