tech-kern archive

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

Re: [PATCH] style(5): No struct typedefs



On 2023-07-14 11:56, Martin Husemann wrote:
On Fri, Jul 14, 2023 at 01:00:26AM +0200, Johnny Billquist wrote:
Using "typedef struct bus_dma_tag *" instead of "typedef void *" will do the
same thing. That is no reason at all why to skip the typedef.

We want to avoid having to #include the header where that typedef lives.

The typedef itself buys you nothing but a few charactes less to type,
but it introduces another layer of indirection where you could (accidently)
introduce inconsistencies (unless you include it from some common
header, which brings us back to the start).

It also brings that if you want to change the definition, you change it in one place, and not 1000.

But I see that your desire is to not have a common place for definitions of shared things. That is certainly a choice as well.

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index