lkml.org 
[lkml]   [2023]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/10] ipmi: kcs_bmc: Define client actions in terms of kcs_bmc_client
On Fri,  3 Nov 2023 16:45:17 +1030
Andrew Jeffery <andrew@codeconstruct.com.au> wrote:

> Operations such as reading and writing from hardware and updating the
> events of interest are operations in which the client is interested, but
> are applied to the device. Strengthen the concept of the client in the
> subsystem and clean up some call-sites by translating between the client
> and device types in the core of the KCS subsystem.
>
> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
> ---
> drivers/char/ipmi/kcs_bmc.c | 67 ++++++++++++++++++---------
> drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 50 ++++++++++----------
> drivers/char/ipmi/kcs_bmc_client.h | 15 +++---
> drivers/char/ipmi/kcs_bmc_serio.c | 10 ++--
> 4 files changed, 81 insertions(+), 61 deletions(-)
>
> diff --git a/drivers/char/ipmi/kcs_bmc.c b/drivers/char/ipmi/kcs_bmc.c
> index 5a3f199241d2..d70e503041bd 100644
> --- a/drivers/char/ipmi/kcs_bmc.c
> +++ b/drivers/char/ipmi/kcs_bmc.c
> @@ -22,33 +22,53 @@ static LIST_HEAD(kcs_bmc_drivers);
>
> /* Consumer data access */
>
> -u8 kcs_bmc_read_data(struct kcs_bmc_device *kcs_bmc)
> +static void kcs_bmc_client_validate(struct kcs_bmc_client *client)
> {
> - return kcs_bmc->ops->io_inputb(kcs_bmc, kcs_bmc->ioreg.idr);
> + WARN_ONCE(client != READ_ONCE(client->dev->client), "KCS client confusion detected");

Is this intended as runtime validation or to catch bugs?
If just catch bugs then fair enough.

With that question answered based on my somewhat vague understanding of the kcs subsystem.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> +}

\
 
 \ /
  Last update: 2023-11-20 13:47    [W:0.245 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site