linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: int340x: Increase bitmap size
@ 2022-03-14 14:50 Srinivas Pandruvada
  2022-03-14 15:28 ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivas Pandruvada @ 2022-03-14 14:50 UTC (permalink / raw)
  To: rafael, daniel.lezcano, amitk, rui.zhang
  Cc: linux-pm, linux-kernel, matthewgarrett, Srinivas Pandruvada, stable

The number of policies are 10, so can't be supported by the bitmap size
of u8. Even though there are no platfoms with these many policies, but
as correctness increase to u16.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Fixes: 16fc8eca1975 ("thermal/int340x_thermal: Add additional UUIDs")
Cc: stable@vger.kernel.org
---
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 72acb1f61849..c2d3df302214 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -53,7 +53,7 @@ struct int3400_thermal_priv {
 	struct art *arts;
 	int trt_count;
 	struct trt *trts;
-	u8 uuid_bitmap;
+	u16 uuid_bitmap;
 	int rel_misc_dev_res;
 	int current_uuid_index;
 	char *data_vault;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] thermal: int340x: Increase bitmap size
  2022-03-14 14:50 [PATCH] thermal: int340x: Increase bitmap size Srinivas Pandruvada
@ 2022-03-14 15:28 ` David Laight
  2022-03-14 18:35   ` srinivas pandruvada
  0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2022-03-14 15:28 UTC (permalink / raw)
  To: 'Srinivas Pandruvada', rafael, daniel.lezcano, amitk, rui.zhang
  Cc: linux-pm, linux-kernel, matthewgarrett, stable

From: Srinivas Pandruvada
> Sent: 14 March 2022 14:50
> 
> The number of policies are 10, so can't be supported by the bitmap size
> of u8. Even though there are no platfoms with these many policies, but
> as correctness increase to u16.

You might as well just use 'unsigned int'.
May generate better code and there is still padding
in the structure.

	David

> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Fixes: 16fc8eca1975 ("thermal/int340x_thermal: Add additional UUIDs")
> Cc: stable@vger.kernel.org
> ---
>  drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index 72acb1f61849..c2d3df302214 100644
> --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> @@ -53,7 +53,7 @@ struct int3400_thermal_priv {
>  	struct art *arts;
>  	int trt_count;
>  	struct trt *trts;
> -	u8 uuid_bitmap;
> +	u16 uuid_bitmap;
>  	int rel_misc_dev_res;
>  	int current_uuid_index;
>  	char *data_vault;
> --
> 2.31.1

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal: int340x: Increase bitmap size
  2022-03-14 15:28 ` David Laight
@ 2022-03-14 18:35   ` srinivas pandruvada
  0 siblings, 0 replies; 3+ messages in thread
From: srinivas pandruvada @ 2022-03-14 18:35 UTC (permalink / raw)
  To: David Laight, rafael, daniel.lezcano, amitk, rui.zhang
  Cc: linux-pm, linux-kernel, matthewgarrett, stable

On Mon, 2022-03-14 at 15:28 +0000, David Laight wrote:
> From: Srinivas Pandruvada
> > Sent: 14 March 2022 14:50
> > 
> > The number of policies are 10, so can't be supported by the bitmap
> > size
> > of u8. Even though there are no platfoms with these many policies,
> > but
> > as correctness increase to u16.
> 
> You might as well just use 'unsigned int'.
> May generate better code and there is still padding
> in the structure.
Correct. I can update the patch.

Thanks,
Srinivas

> 
>         David
> 
> > 
> > Signed-off-by: Srinivas Pandruvada <
> > srinivas.pandruvada@linux.intel.com>
> > Fixes: 16fc8eca1975 ("thermal/int340x_thermal: Add additional
> > UUIDs")
> > Cc: stable@vger.kernel.org
> > ---
> >  drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git
> > a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> > b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> > index 72acb1f61849..c2d3df302214 100644
> > --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> > +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> > @@ -53,7 +53,7 @@ struct int3400_thermal_priv {
> >         struct art *arts;
> >         int trt_count;
> >         struct trt *trts;
> > -       u8 uuid_bitmap;
> > +       u16 uuid_bitmap;
> >         int rel_misc_dev_res;
> >         int current_uuid_index;
> >         char *data_vault;
> > --
> > 2.31.1
> 
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes,
> MK1 1PT, UK
> Registration No: 1397386 (Wales)
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-14 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 14:50 [PATCH] thermal: int340x: Increase bitmap size Srinivas Pandruvada
2022-03-14 15:28 ` David Laight
2022-03-14 18:35   ` srinivas pandruvada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).