[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:34:29 +0330 |
On Mon, Dec 20, 2021 at 11:01:04PM +0100, Jose E. Marchesi wrote:
>
> >>
> >> 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?
> >
> > Oh, so this is because the sub IOD uses calls like ios_search_by_id? If
> > that is the only IOD that needs such operations, it seems to me that it
> > may be better to handle it in a special way rather than "polluting" the
> > interface...
>
> No, scratch that.
>
> Now I realize that having an user data payload associated with the IOD
> and passed to `open' may be also very useful for foreign IO devices.
> That was a very good idea, thanks :)
>
> The struct pk_iod_if in libpoke.h would have to be expanded accordingly.
>
> If you agree with this change, can you please split the patch in two,
> one with the addition of the user data pointer, then with the removal of
> the global state?
>
OK.
[PATCH v2 1/2] pkl: Add user_data in IO device API, Mohammad-Reza Nabipoor, 2021/12/23
[PATCH v4] pkl: Remove global state from IOS, Mohammad-Reza Nabipoor, 2021/12/28
Re: [PATCH v4] pkl: Remove global state from IOS, Jose E. Marchesi, 2021/12/28
Re: [PATCH v2 1/2] pkl: Add user_data in IO device API, Jose E. Marchesi, 2021/12/23