Search Linux Wireless

Re: RFC: Broadcom fmac wireless driver cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17/07/17 13:41, Arend van Spriel wrote:
>> * Gets rid of the arbitrary and completely 1:1 mapping of
>>  struct brcmf_{core,chip}_priv/struct brcmf_{core,chip} structures
>>  which add unreadability whilst offering no real seperation.
> It is maybe 1:1 but it assures that whatever is in the priv structures
> in only accessible in chip.c. Why would that not offer any real separation.

Ok, I'm going to keep this to technical points from now on, everyones
had a chance to say how they feel about it now :)

To address your specific comment above - "Why would that not offer any
real separation"

The two structures *always* exist together. And yes, preventing access
to the members that we don't want accessed from the wrong layer would
be *possibly* worthwhile, however the driver code as it stands
*constantly* short circuits that with the use of offsetof().

This makes any minimal protection against poor coding practice
completely irrelevant, at the same time as making the code unreadable.

If the separation is to stay, it needs to be re-written such that
offsetof() is not required throughout the code.

I've re-done my patchset, which I'll resubmit in just a moment.

My preferred solution is still removal, as nothing outside this driver
will ever touch these structures anyway, so all they are doing, other
than making the code impossible to maintain, is protecting us from no-one.

-Ian



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux