Negative value returns for sensor in tiogapass
Jayashree D
jayashree-d at hcl.com
Fri Feb 26 19:55:05 AEDT 2021
Classification: Public
Hi Team,
Recently, I have tested sensors for tiogapass, in which one sensor returns negative value.
After analysing the code in the dbus-sensors repo, I found the following issue.
dbus-sensors/IpmbSensor.cpp at master * openbmc/dbus-sensors (github.com)<https://github.com/openbmc/dbus-sensors/blob/master/src/IpmbSensor.cpp#L267>
>From the above link, We need only below line in the code to process the HSC sensors value for tiogapass.
int16_t value = ((data[4] << 8) | data[3]);
Since the below logic is added, the values get shifted and getting negative values as output.
constexpr const size_t shift = 16 - 11; // 11bit into 16bit
value <<= shift;
value >>= shift;
Could you please suggest any idea to resolve this issue.
Regards,
Jayashree
::DISCLAIMER::
________________________________
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20210226/a1a24e3c/attachment-0001.htm>
More information about the openbmc
mailing list