[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOMdWSKmNVQTpJtdEMNHc5SS75WNS7F0duzQi14kg62R4Un8zA@mail.gmail.com>
Date: Tue, 1 Sep 2020 15:36:46 +0530
From: Allen <allen.lkml@...il.com>
To: jejb@...ux.ibm.com
Cc: Kees Cook <keescook@...omium.org>,
Allen Pais <allen.cryptic@...il.com>,
martin.petersen@...cle.com, kashyap.desai@...adcom.com,
sumit.saxena@...adcom.com, shivasharan.srikanteshwara@...adcom.com,
linux-scsi@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
target-devel@...r.kernel.org, megaraidlinux.pdl@...adcom.com
Subject: Re: [PATCH 0/8] scsi: convert tasklets to use new tasklet_setup()
> > > >
> > > > Commit 12cc923f1ccc ("tasklet: Introduce new initialization
> > > > API")' introduced a new tasklet initialization API. This series
> > > > converts all the scsi drivers to use the new tasklet_setup() API
> > >
> > > I've got to say I agree with Jens, this was a silly obfuscation:
> > >
> > > +#define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
> > > + container_of(callback_tasklet, typeof(*var),
> > > tasklet_fieldname)
> > >
> > > Just use container_of directly since we all understand what it
> > > does.
> >
> > But then the lines get really long, wrapped, etc.
>
> I really don't think that's a problem but if you want to add a new
> generic container_of that does typeof instead of insisting on the type,
> I'd be sort of OK with that ... provided you don't gratuitously alter
> the argument order.
>
> The thing I object to is that this encourages everyone to roll their
> own unnecessary container_of type macros in spite of the fact that it's
> function is wholly generic. It's fine if you're eliminating one of the
> arguments, or actually making the macro specific to the type, but in
> this case you're not, you're making a completely generic macro where
> the name is the only thing that's specific to this case.
>
> > This is what the timer_struct conversion did too (added a
> > container_of wrapper), so I think it makes sense here too.
>
> I didn't see that one to object to it ...
Since we could not get the generic API accepted, can I send out V2
which would use container_of()?
Thanks,
--
- Allen
Powered by blists - more mailing lists