From f5a5ec2d81b63237f71994e1308f7e7b364fd1fb Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 30 Nov 2020 15:45:22 +0900 Subject: [PATCH] drivers/sensors/lm75.c: Fix syslog format --- drivers/sensors/lm75.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/sensors/lm75.c b/drivers/sensors/lm75.c index 691c9e2c68..b165d5d4be 100644 --- a/drivers/sensors/lm75.c +++ b/drivers/sensors/lm75.c @@ -40,6 +40,7 @@ #include +#include #include #include #include @@ -219,7 +220,8 @@ static int lm75_readb16(FAR struct lm75_dev_s *priv, uint8_t regaddr, */ *regvalue = b8tob16((b8_t)buffer[0] << 8 | (b8_t)buffer[1]); - sninfo("addr: %02x value: %08x ret: %d\n", regaddr, *regvalue, ret); + sninfo("addr: %02x value: %08" PRIx32 " ret: %d\n", + regaddr, *regvalue, ret); return OK; } @@ -238,7 +240,7 @@ static int lm75_writeb16(FAR struct lm75_dev_s *priv, uint8_t regaddr, uint8_t buffer[3]; b8_t regb8; - sninfo("addr: %02x value: %08x\n", regaddr, regval); + sninfo("addr: %02x value: %08" PRIx32 "\n", regaddr, regval); /* Set up a 3 byte message to send */ @@ -277,7 +279,7 @@ static int lm75_readtemp(FAR struct lm75_dev_s *priv, FAR b16_t *temp) add_sensor_randomness(temp16); - sninfo("Centigrade: %08x\n", temp16); + sninfo("Centigrade: %08" PRIx32 "\n", temp16); /* Was fahrenheit requested? */ @@ -286,7 +288,7 @@ static int lm75_readtemp(FAR struct lm75_dev_s *priv, FAR b16_t *temp) /* Centigrade to Fahrenheit conversion: F = 9*C/5 + 32 */ temp16 = b16mulb16(temp16, B16_9DIV5) + B16_32; - sninfo("Fahrenheit: %08x\n", temp16); + sninfo("Fahrenheit: %08" PRIx32 "\n", temp16); } *temp = temp16; @@ -509,7 +511,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm75_readb16(priv, LM75_THYS_REG, ptr); - sninfo("THYS: %08x ret: %d\n", *ptr, ret); + sninfo("THYS: %08" PRIx32 " ret: %d\n", *ptr, ret); } break; @@ -517,7 +519,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETHYS: ret = lm75_writeb16(priv, LM75_THYS_REG, (b16_t)arg); - sninfo("THYS: %08x ret: %d\n", (b16_t)arg, ret); + sninfo("THYS: %08" PRIx32 " ret: %d\n", (b16_t)arg, ret); break; /* Read TOS (Over-temp Shutdown Threshold) Register. @@ -529,7 +531,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm75_readb16(priv, LM75_TOS_REG, ptr); - sninfo("TOS: %08x ret: %d\n", *ptr, ret); + sninfo("TOS: %08" PRIx32 " ret: %d\n", *ptr, ret); } break; @@ -539,7 +541,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETOS: ret = lm75_writeb16(priv, LM75_TOS_REG, (b16_t)arg); - sninfo("TOS: %08x ret: %d\n", (b16_t)arg, ret); + sninfo("TOS: %08" PRIx32 " ret: %d\n", (b16_t)arg, ret); break; default: