what exactly is the purpose of the code in question?
also, so many loops and hoops, and switch-in-switch. Are you sure there isn't a better solution? Like stuff it into function.
I'm not exactly happy about isSupermicro. The next thing you know, Dell comes and we'll have isDell. Then HP with isHP. Then Oracle ... If anything, variable like 'print_sensor = 1;' and set it to 0 in case of Supermicro.
please, check modified version of your patch. I've cleaned up unused variables and changed formatting here and there. I've also removed the following code as it did nothing:
sensor_type is always 0x6F as you don't modify or work with it anywhere in the code. How can it match TYPE_MEMORY or TYPE_SUPERMICRO_OEM then? Please, clarify.
I check the event_type whether it is 0x6F then check the sensor_type whether it is TYPE_MEMORY or TYPE_SUPERMICRO_OEM. I check the event and sensor two types.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
the following code is duplicated in patch
what exactly is the purpose of the code in question?
I'm not exactly happy about isSupermicro. The next thing you know, Dell comes and we'll have isDell. Then HP with isHP. Then Oracle ... If anything, variable like 'print_sensor = 1;' and set it to 0 in case of Supermicro.
Thank you for your review. I modified the uncomfortable code.
Hello KC,
please, check modified version of your patch. I've cleaned up unused variables and changed formatting here and there. I've also removed the following code as it did nothing:
I remain confused over one thing, though.
sensor_type is always 0x6F as you don't modify or work with it anywhere in the code. How can it match TYPE_MEMORY or TYPE_SUPERMICRO_OEM then? Please, clarify.
Thanks.
I check the event_type whether it is 0x6F then check the sensor_type whether it is TYPE_MEMORY or TYPE_SUPERMICRO_OEM. I check the event and sensor two types.
KC, you're right. My bad and I have no idea how I could overlook it even though I've pasted the code in question. My excuse is an early morning.
Anyway, please, check attached patch with this issue fixed.
Zdenek, the code is ok with me. Thank you for your help.
Committed into CVS.