2010-11-05 03:00:16

by Guenter Roeck

[permalink] [raw]
Subject: Re: [lm-sensors] [PATCH 6/8] hwmon: applesmc: Dynamic creation of fan files

On Sun, Oct 31, 2010 at 03:50:32AM -0400, Henrik Rydberg wrote:
> With the dynamic temperature group in place, the setup of fans
> can be simplified. This patch sets up the fans dynamically, removing
> a hundred lines of code.
>
> Signed-off-by: Henrik Rydberg <[email protected]>

Hi Henrik,

just one minor comment.

> ---
> drivers/hwmon/applesmc.c | 188 +++++++++++-----------------------------------
> 1 files changed, 43 insertions(+), 145 deletions(-)
>
> diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
> index abbff0b..4ba20ec 100644
> --- a/drivers/hwmon/applesmc.c
> +++ b/drivers/hwmon/applesmc.c
[ ... ]

> static int applesmc_init_smcreg_try(void)
> {
> struct applesmc_registers *s = &smcreg;
> + u8 tmp[4];

Why tmp[4] if you only read one byte ?

Guenter


2010-11-05 08:56:49

by Henrik Rydberg

[permalink] [raw]
Subject: Re: [lm-sensors] [PATCH 6/8] hwmon: applesmc: Dynamic creation of fan files

>> static int applesmc_init_smcreg_try(void)

>> {
>> struct applesmc_registers *s = &smcreg;
>> + u8 tmp[4];
>
> Why tmp[4] if you only read one byte ?


Alignment optimization, perhaps? :-) I'll change it.

Thanks,
Henrik