Thread (14 messages) flat view 14 messages, 2 authors, 2023-01-20

Re: [PATCH net-next 7/8] net: microchip: sparx5: Add support for IS0 VCAP ethernet protocol types

From: Steen Hegelund <steen.hegelund@microchip.com>
Date: 2023-01-20 09:38:25
Also in: lkml, netdev

Hi Dan,

On Fri, 2023-01-20 at 12:20 +0300, Dan Carpenter wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the
content is safe

On Fri, Jan 20, 2023 at 10:08:30AM +0100, Steen Hegelund wrote:
quoted
+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".
Good catch.  I will update that.
quoted
+     }
+     for (idx = 0; idx < size; ++idx)
+             if (known_etypes[idx] == etype)
+                     return true;
+     return false;
+}
regards,
dan carpenter
Thanks for the review.

BR
Steen


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help