Re: [PATCHv2 wireless-next] wifi: brcmsmac: use FAM for debug code

From: Arend van Spriel

Date: Sat Mar 28 2026 - 06:49:56 EST


On 10/03/2026 02:47, Rosen Penev wrote:
On Mon, Mar 9, 2026 at 6:11 PM Julian Calaby <julian.calaby@xxxxxxxxx> wrote:

Hi Arend,

On Tue, Mar 10, 2026 at 8:59 AM Rosen Penev <rosenp@xxxxxxxxx> wrote:

Debug code requires a separate allocation to duplicate a string. A FAM
allows properly sized allocation with a single kfree.

Sorry Rosen for hijacking your patch here.

With these changes, does allocating and copying the string really need
to be behind a DEBUG ifdef?
I don't know. I didn't write this code.

Thanks, Rosen

I did before the concept of FAM landed in the kernel. Whether or not the #ifdef DEBUG is warranted is simply a choice. I prefer to have clean separation of functionality and the related data. If the code using the data is all conditional under DEBUG define then the data must be as well.

I understand that FAM and compiler support for it has its advantages, but this is more churn than gain. The code is functional as is and removing #defines for the sake of changing to a FAM seems not justified for the advantages which in my opinion are pretty limited in this particular case.

Regards,
Arend