You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/02 12:50:15 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8009: arm64/a64: add driver for Allwinner A64 I2C bus

xiaoxiang781216 commented on code in PR #8009:
URL: https://github.com/apache/nuttx/pull/8009#discussion_r1060013555


##########
drivers/sensors/mpu60x0.c:
##########
@@ -404,7 +404,7 @@ static int __mpu_read_reg_i2c(FAR struct mpu_dev_s *dev,
   msg[0].frequency = CONFIG_MPU60X0_I2C_FREQ;
   msg[0].addr      = dev->config.addr;
   msg[0].flags     = I2C_M_NOSTOP;
-  msg[0].buffer    = &reg_addr;
+  msg[0].buffer    = (uint8_t *)&reg_addr;

Review Comment:
   it's better to change reg_addr type to uint8_t since mpu_regaddr_e may have 4bytes length and the cast only work for little endian machine.



##########
drivers/sensors/mpu60x0.c:
##########
@@ -433,7 +433,7 @@ static int __mpu_write_reg_i2c(FAR struct mpu_dev_s *dev,
   msg[0].frequency = CONFIG_MPU60X0_I2C_FREQ;
   msg[0].addr      = dev->config.addr;
   msg[0].flags     = I2C_M_NOSTOP;
-  msg[0].buffer    = &reg_addr;
+  msg[0].buffer    = (uint8_t *)&reg_addr;

Review Comment:
   ditto



##########
drivers/sensors/mpu60x0.c:
##########
@@ -870,7 +870,7 @@ static ssize_t mpu_write(FAR struct file *filep, FAR const char *buf,
 
   UNUSED(inode);
   UNUSED(dev);
-  snerr("ERROR: %p %p %d\n", inode, dev, len);
+  snerr("ERROR: %p %p %d\n", inode, dev, (int)len);

Review Comment:
   snerr("ERROR: %p %p %zu\n", inode, dev, len);



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org