]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pds_core: init viftype default in declaration
authorShannon Nelson <shannon.nelson@amd.com>
Fri, 25 Apr 2025 20:46:18 +0000 (13:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Apr 2025 11:55:59 +0000 (12:55 +0100)
Initialize the .enabled field of the FWCTL viftype default in
the declaration rather than as a bit of code as it is always
to be enabled and needs no logic around it.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/pds_core/core.c

index 0e408f990f0b25027e3fdc990bda0126c90c4d1c..076dfe2910c770b332080e5a9850c426f5f3dddb 100644 (file)
@@ -402,6 +402,7 @@ err_out_uninit:
 
 static struct pdsc_viftype pdsc_viftype_defaults[] = {
        [PDS_DEV_TYPE_FWCTL] = { .name = PDS_DEV_TYPE_FWCTL_STR,
+                                .enabled = true,
                                 .vif_id = PDS_DEV_TYPE_FWCTL,
                                 .dl_id = -1 },
        [PDS_DEV_TYPE_VDPA] = { .name = PDS_DEV_TYPE_VDPA_STR,
@@ -432,9 +433,6 @@ static int pdsc_viftypes_init(struct pdsc *pdsc)
                /* See what the Core device has for support */
                vt_support = !!le16_to_cpu(pdsc->dev_ident.vif_types[vt]);
 
-               if (vt == PDS_DEV_TYPE_FWCTL)
-                       pdsc->viftype_status[vt].enabled = true;
-
                dev_dbg(pdsc->dev, "VIF %s is %ssupported\n",
                        pdsc->viftype_status[vt].name,
                        vt_support ? "" : "not ");