[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pkl: Remove global state from IOS
From: |
Mohammad-Reza Nabipoor |
Subject: |
Re: [PATCH] pkl: Remove global state from IOS |
Date: |
Tue, 21 Dec 2021 01:12:38 +0330 |
Hi, Jose.
On Mon, Dec 20, 2021 at 10:12:16PM +0100, Jose E. Marchesi wrote:
>
> > This patch removes global state from IOS by introducing a new struct
> > `ios_meta`.
>
> I would much prefer to use the name `ios_context' for this type, or
> `ios_ctx' if you want it shorter.
OK.
> > I changed `open` function pointer of `struct pk_iod_if` to be compatible
> > with the rest of world. But user doesn't need (and should not care about
> > this new first parameter). I don't like this new unused parameter here.
> > WDYT?
>
> Huh, why would you want to pass the ios context to the IOD implementations?
>
TBH I don't want :)
I think I can solve this problem by adding new field to `struct ios_dev_if`:
void *userdata;
And changing the `open` signature to have a new `void *userdata` param.
Based on that I can call the right `open` function (specified by the user).
WDYT?
[PATCH v2 1/2] pkl: Add user_data in IO device API, Mohammad-Reza Nabipoor, 2021/12/23