[PATCH skeleton v6 17/20] Generate thermaltrip event

Stewart Smith stewart at linux.vnet.ibm.com
Thu Apr 21 03:22:47 AEST 2016


OpenBMC Patches <openbmc-patches at stwcx.xyz> writes:
> From: johnhcwang <hsienchiang at gmail.com>
>
> Keep the original design from v2.10
[ 12 more citation lines. Click/Enter to show. ]
> ---
>  objects/info.c | 121
> ++++++++++++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 95 insertions(+), 26 deletions(-)
>
> diff --git a/objects/info.c b/objects/info.c
> index 8e08974..386133c 100644
> --- a/objects/info.c
> +++ b/objects/info.c
> @@ -6,9 +6,37 @@
>  #include "i2c-dev.h"
>  #include "log.h"
>  
> +
> +#define NUM_CPU_CORE	12

It would be much better to detect this at runtime. There's likely to at
some point exist a chip with >12 cores.

>  const char *gService = "org.openbmc.Sensors";
> -const char *gObjPath = "/org/openbmc/sensors/temperature/cpu0/core0";
> -const char *gObjPath_o = "/org/openbmc/sensors/host/OccStatus";
> +const char *gCPU0ObjPath[NUM_CPU_CORE] =
> {"/org/openbmc/sensors/temperature/cpu0/core0",

Why not construct with snprintf() at runtime?

> +		if(HighestCPUtemp >= 90) {

Why is this hardcoded here?


-- 
Stewart Smith
OPAL Architect, IBM.



More information about the openbmc mailing list