Re: [PATCH v5 4/4] staging: octeon: refactor to per-device state and pass platform_device

From: Ayush Mukkanwar

Date: Tue Apr 28 2026 - 10:36:13 EST


On Tue, Apr 28, 2026 at 3:18 PM Dan Carpenter <error27@xxxxxxxxx> wrote:
>
> On Mon, Apr 27, 2026 at 08:45:55PM +0530, Ayush Mukkanwar wrote:
> > Move the static oct_rx_group array from ethernet-rx.c into the
> > octeon_ethernet_platform structure to associate receive group state
> > with the platform device.
>
> How is this related to logging?
>
> > Pass struct platform_device instead of
> > struct device through the ethernet-mem and ethernet-rx call chains,
> > extracting &pdev->dev only at the point of use in dev_warn() calls.
>
> You're undoing something that you did in patch 1. Just do it
> correctly the first time instead of doing it and the fixing it
> in the same patchset.
>
> >
> > Move struct oct_rx_group and struct octeon_ethernet_platform
> > definitions into octeon-ethernet.h so they are shared across
> > compilation units.
> >
>
> Btw, here:
>
> > + struct octeon_ethernet_platform *plt = platform_get_drvdata(pdev);
>
> Could you name it "plat" instead of "plt"? Generally "plt" is an
> acronym for something else. Procedure Linkage Table or
> Phy LED Trigger. There are a couple other meanings.
>
> regards,
> dan carpenter
>

Thanks for the review, Dan.

The rx_group refactoring was requested by Greg in his v4 review. The
logging conversion required storing a device pointer in the static
oct_rx_group array to pass it through the rx poll path. Greg asked to
eliminate that global state by moving it into the platform device
local structure.

You're right that I should fold the platform_device change into the
earlier patches to avoid the undo. I'll also rename plt to plat. Will
send v6 with these fixes.