All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (dell-smm) Pack the whole smm_regs struct
@ 2021-12-21 16:28 Armin Wolf
  2021-12-21 16:55 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Armin Wolf @ 2021-12-21 16:28 UTC (permalink / raw)
  To: pali; +Cc: jdelvare, linux, linux-hwmon, linux-kernel

When desiring the whole struct to be packed, __packed
should be applied to the whole struct, not just
every struct member except the first one.

Tested on a Dell Inspiron 3505.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/hwmon/dell-smm-hwmon.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index d8c6e75bb374..d401f9acf450 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -113,12 +113,12 @@ MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed (default: autodetect)"

 struct smm_regs {
 	unsigned int eax;
-	unsigned int ebx __packed;
-	unsigned int ecx __packed;
-	unsigned int edx __packed;
-	unsigned int esi __packed;
-	unsigned int edi __packed;
-};
+	unsigned int ebx;
+	unsigned int ecx;
+	unsigned int edx;
+	unsigned int esi;
+	unsigned int edi;
+} __packed;

 static const char * const temp_labels[] = {
 	"CPU",
--
2.30.2


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

* Re: [PATCH] hwmon: (dell-smm) Pack the whole smm_regs struct
  2021-12-21 16:28 [PATCH] hwmon: (dell-smm) Pack the whole smm_regs struct Armin Wolf
@ 2021-12-21 16:55 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-12-21 16:55 UTC (permalink / raw)
  To: Armin Wolf; +Cc: pali, jdelvare, linux-hwmon, linux-kernel

On Tue, Dec 21, 2021 at 05:28:05PM +0100, Armin Wolf wrote:
> When desiring the whole struct to be packed, __packed
> should be applied to the whole struct, not just
> every struct member except the first one.
> 
> Tested on a Dell Inspiron 3505.
> 
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/dell-smm-hwmon.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> --
> 2.30.2
> 
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index d8c6e75bb374..d401f9acf450 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -113,12 +113,12 @@ MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed (default: autodetect)"
> 
>  struct smm_regs {
>  	unsigned int eax;
> -	unsigned int ebx __packed;
> -	unsigned int ecx __packed;
> -	unsigned int edx __packed;
> -	unsigned int esi __packed;
> -	unsigned int edi __packed;
> -};
> +	unsigned int ebx;
> +	unsigned int ecx;
> +	unsigned int edx;
> +	unsigned int esi;
> +	unsigned int edi;
> +} __packed;
> 
>  static const char * const temp_labels[] = {
>  	"CPU",

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

end of thread, other threads:[~2021-12-21 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 16:28 [PATCH] hwmon: (dell-smm) Pack the whole smm_regs struct Armin Wolf
2021-12-21 16:55 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.