Re: [PATCH net-next] net: mana: Enable debugfs files for MANA device

From: Jakub Kicinski
Date: Thu Oct 03 2024 - 20:05:33 EST


On Mon, 30 Sep 2024 20:40:41 -0700 Shradha Gupta wrote:
> @@ -1516,6 +1519,13 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> gc->bar0_va = bar0_va;
> gc->dev = &pdev->dev;
>
> + if (gc->is_pf) {
> + gc->mana_pci_debugfs = debugfs_create_dir("0", mana_debugfs_root);
> + } else {
> + gc->mana_pci_debugfs = debugfs_create_dir(pci_slot_name(pdev->slot),
> + mana_debugfs_root);
> + }

no need for brackets around single statements


> @@ -1619,7 +1640,29 @@ static struct pci_driver mana_driver = {
> .shutdown = mana_gd_shutdown,
> };
>
> -module_pci_driver(mana_driver);
> +static int __init mana_driver_init(void)
> +{
> + int err;
> +
> + mana_debugfs_root = debugfs_create_dir("mana", NULL);
> +
> + err = pci_register_driver(&mana_driver);
> +

no need for empty lines between function call and its error check

> + if (err)
> + debugfs_remove(mana_debugfs_root);
> +
> + return err;
> +}
> +
> +static void __exit mana_driver_exit(void)
> +{
> + debugfs_remove(mana_debugfs_root);
> +
> + pci_unregister_driver(&mana_driver);
> +}
> +
> +module_init(mana_driver_init);
> +module_exit(mana_driver_exit);
>
> MODULE_DEVICE_TABLE(pci, mana_id_table);
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index c47266d1c7c2..255f3189f6fa 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -9,6 +9,7 @@
> #include <linux/filter.h>
> #include <linux/mm.h>
> #include <linux/pci.h>
> +#include <linux/debugfs.h>

looks like the headers were previously alphabetically sorted.
--
pw-bot: cr