OpenBIC icon indicating copy to clipboard operation
OpenBIC copied to clipboard

Some declarations of common sensor functions are not matched to their corresponding definitions.

Open Scron-Chang opened this issue 3 years ago • 0 comments

Hi @DelphineChiu

I got some error messages from the Build and Analyze: run-cppcheck task.

Files to check:
common/service/sensor/sensor.c
Errors Found:
common/service/sensor/sensor.c:274:26:Function 'stby_access' argument 1 names different: declaration 'sensor_num' definition 'sensor_number'.
common/service/sensor/sensor.c:279:24:Function 'dc_access' argument 1 names different: declaration 'sensor_num' definition 'sensor_number'.
common/service/sensor/sensor.c:284:26:Function 'post_access' argument 1 names different: declaration 'sensor_num' definition 'sensor_number'.
common/service/sensor/sensor.c:289:24:Function 'me_access' argument 1 names different: declaration 'sensor_num' definition 'sensor_number'.

The root cause should be some declarations don't match their corresponding definition. For instance, https://github.com/facebook/OpenBIC/blob/6e194a7927e37978f6f67085da82a40bc5709b4e/common/service/sensor/sensor.c#L272-L275 https://github.com/facebook/OpenBIC/blob/6e194a7927e37978f6f67085da82a40bc5709b4e/common/service/sensor/sensor.h#L219

What would you suggest to handle this issue?

Scron-Chang avatar May 18 '22 07:05 Scron-Chang