From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH v2 1/2] hwmon: (lm90) Convert some macros
Date: Mon, 23 Jun 2008 17:06:26 +0000 [thread overview]
Message-ID: <20080623190626.7ae2e4bf@hyperion.delvare> (raw)
In-Reply-To: <1213989596-8716-2-git-send-email-ncase@xes-inc.com>
Hi Nate,
On Fri, 20 Jun 2008 14:19:55 -0500, Nate Case wrote:
> Use static functions instead of the TEMPx_FROM_REG* and TEMPx_TO_REG*
> macros. This will ensure type safety and eliminate any side effects
> from arguments passed in since the macros referenced 'val' multiple
> times. This change should not affect functionality.
Almost correct, but I get the following warnings at build time:
drivers/hwmon/lm90.c: In function "show_temp8":
drivers/hwmon/lm90.c:282: warning: format "%d" expects type "int", but argument 3 has type "long int"
drivers/hwmon/lm90.c:282: warning: format "%d" expects type "int", but argument 3 has type "long int"
drivers/hwmon/lm90.c: In function "show_temp11":
drivers/hwmon/lm90.c:316: warning: format "%d" expects type "int", but argument 3 has type "long int"
drivers/hwmon/lm90.c:316: warning: format "%d" expects type "int", but argument 3 has type "long int"
drivers/hwmon/lm90.c: In function "show_temphyst":
drivers/hwmon/lm90.c:356: warning: format "%d" expects type "int", but argument 3 has type "long int"
drivers/hwmon/lm90.c:356: warning: format "%d" expects type "int", but argument 3 has type "long int"
This is because you changed temp1_from_reg and temp2_from_reg to return
longs instead of ints. We don't need longs, so the easiest fix is to
revert that change. If you insist on returning longs then you must
change %d to %ld in the sprintf calls.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2008-06-23 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-20 19:19 [lm-sensors] [PATCH v2 1/2] hwmon: (lm90) Convert some macros to Nate Case
2008-06-23 17:06 ` Jean Delvare [this message]
2008-06-24 20:42 ` [lm-sensors] [PATCH v2 1/2] hwmon: (lm90) Convert some macros Nate Case
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=20080623190626.7ae2e4bf@hyperion.delvare \
--to=khali@linux-fr.org \
--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.