lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 May 2024 14:43:23 +0200
From: Nuno Sá <noname.nuno@...il.com>
To: Angelo Dureghello <adureghello@...libre.com>, jic23@...nel.org, 
	robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org
Cc: nuno.sa@...log.com, lars@...afoo.de, Michael.Hennerich@...log.com, 
	linux-iio@...r.kernel.org, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/6] iio: dac: ad3552r: add model data structure

On Wed, 2024-05-22 at 17:01 +0200, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@...libre.com>
> 
> Add a "model data" structure to keep useful hardware-related
> information as from datasheet, avoiding id-based conditional
> choices later on.
> 
> Removed id-based checks and filled model-specific structures
> with device specific features, In particular, num_hw_channels
> is introduced to keep the number of hardware implemented
> channels, since 1-channel versions of the DACs are added
> in this same patchset.
> 
> Signed-off-by: Angelo Dureghello <adureghello@...libre.com>
> ---
> Changes for v2:
> - patch added in v2
> ---
>  drivers/iio/dac/ad3552r.c | 98 +++++++++++++++++++++++----------------
>  1 file changed, 59 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
> index a492e8f2fc0f..6a40c7eece1f 100644
> --- a/drivers/iio/dac/ad3552r.c
> +++ b/drivers/iio/dac/ad3552r.c
> @@ -261,7 +261,17 @@ struct ad3552r_ch_data {
>  	bool	range_override;
>  };
>  
> +struct ad3552r_model_data {
> +	const char *model_name;
> +	enum ad3542r_id chip_id;
> +	unsigned int num_hw_channels;
> +	const s32 (*ranges_table)[2];
> +	int num_ranges;
> +	bool requires_output_range;
> +};
> +

nit: we often would call this (in IIO) ad3552r_chip_info. Then...
>  struct ad3552r_desc {
> +	const struct ad3552r_model_data *model_data;

*chip_info;

Anyways, not really something worth a re-spin. But if you need one, something to
consider :)

- Nuno Sá



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ