All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 3/6] hwmon: (lm80) Convert temperature display function macros into function
Date: Sun, 20 Apr 2014 20:07:25 +0000	[thread overview]
Message-ID: <535428FD.7010103@roeck-us.net> (raw)
In-Reply-To: <1397615334-30317-3-git-send-email-linux@roeck-us.net>

On 04/15/2014 07:28 PM, Guenter Roeck wrote:
> Convert temperature display function macros into functions to reduce
> code size and improve code readability.
>
> Code size reduction is about 2k on x86_64.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>   drivers/hwmon/lm80.c |  134 ++++++++++++++++++++++----------------------------
>   1 file changed, 59 insertions(+), 75 deletions(-)
>
> diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
> index fe980d6..a9749fd 100644
> --- a/drivers/hwmon/lm80.c
> +++ b/drivers/hwmon/lm80.c
> @@ -92,6 +92,23 @@ static inline unsigned char FAN_TO_REG(unsigned rpm, unsigned div)
>
>   #define DIV_FROM_REG(val)		(1 << (val))
>
> +enum temp_index {
> +	t_input = 0,
> +	t_hot_max,
> +	t_hot_hyst,
> +	t_os_max,
> +	t_os_hyst,
> +	t_num_temp
> +};
> +
> +static u8 temp_regs[] = {

Note that I've made this array a const.



_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

      reply	other threads:[~2014-04-20 20:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  2:28 [lm-sensors] [PATCH 3/6] hwmon: (lm80) Convert temperature display function macros into functions Guenter Roeck
2014-04-20 20:07 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535428FD.7010103@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.