<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2">Hi Cyril,<br><br>Thanks for review. Please see bellow:<br><br><font color="#990099">-----"openbmc" <<a target="_blank" href="mailto:openbmc-bounces+shliyi=cn.ibm.com@lists.ozlabs.org">openbmc-bounces+shliyi=cn.ibm.com@lists.ozlabs.org</a>> wrote: -----</font><br><br>>To: OpenBMC Patches <<a target="_blank" href="mailto:openbmc-patches@stwcx.xyz">openbmc-patches@stwcx.xyz</a>>, <<a target="_blank" href="mailto:adamliyi@msn.com">adamliyi@msn.com</a>><br>>From: Cyril Bur <br>>Sent by: "openbmc" <br>>Date: 03/03/2016 04:55AM<br>>Cc: <a target="_blank" href="mailto:openbmc@lists.ozlabs.org">openbmc@lists.ozlabs.org</a><br>>Subject: Re: [PATCH linux] hwmon: fix occ hwmon driver compile<br>>warning message<br>><br>>On Mon, 29 Feb 2016 05:00:42 -0600<br>>OpenBMC Patches <<a target="_blank" href="mailto:openbmc-patches@stwcx.xyz">openbmc-patches@stwcx.xyz</a>> wrote:<br>><br>>> From: Yi Li <<a target="_blank" href="mailto:adamliyi@msn.com">adamliyi@msn.com</a>><br>>> <br>>> Fixed warning message when compiling occ hwmon driver.<br>>> The issue is tracked by: <a target="_blank" href="https://github.com/openbmc/linux/issues/44">https://github.com/openbmc/linux/issues/44</a><br>>> <br>><br>>Hi Adam,<br>><br>>I'm not sure what the accepted way of doing it is here, just thought<br>>I would<br>>double check that __be16 is the accepted type here?<br>><br>>I wonder if you declared data as a void * and then had 8 16 and 32<br>>accessors<br>>for it? That might be nicer...<br>><br><br>From: <a target="_blank" href="http://lxr.free-electrons.com/source/include/uapi/linux/byteorder/big_endian.h#L87">http://lxr.free-electrons.com/source/include/uapi/linux/byteorder/big_endian.h#L87</a><br>"<br><pre style="font-family: Monaco,"Courier New",Courier,monospace; font-size: 0.95em; padding: 1em; overflow: auto; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; background-color: rgb(255, 255, 255);"><font color="#787878"> <a name="L87" href="http://lxr.free-electrons.com/source/include/uapi/linux/byteorder/big_endian.h#L87" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">87</a> static inline <a href="http://lxr.free-electrons.com/ident?i=__u16" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">__u16</a> <a href="http://lxr.free-electrons.com/ident?i=__be16_to_cpup" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">__be16_to_cpup</a>(const <a href="http://lxr.free-electrons.com/ident?i=__be16" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">__be16</a> *<a href="http://lxr.free-electrons.com/ident?i=p" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">p</a>)
<a name="L88" href="http://lxr.free-electrons.com/source/include/uapi/linux/byteorder/big_endian.h#L88" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">88</a> {
<a name="L89" href="http://lxr.free-electrons.com/source/include/uapi/linux/byteorder/big_endian.h#L89" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">89</a> return (<a href="http://lxr.free-electrons.com/ident?i=__force" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">__force</a> <a href="http://lxr.free-electrons.com/ident?i=__u16" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">__u16</a>)*<a href="http://lxr.free-electrons.com/ident?i=p" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">p</a>;
<a name="L90" href="http://lxr.free-electrons.com/source/include/uapi/linux/byteorder/big_endian.h#L90" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black; background-color: white;">90</a> }</font></pre>"<br>So I convert (uint16_t *) to (const __be16 *) to remove compile warning.<br>And I am not quite understand "declared data as a void * and then had 8 16 and 32 accessors".<br>Can you give an example?<br><br>Thanks,<br>-Yi<br></font><BR>