On 08/04/2024 23.33, Philippe Mathieu-Daudé wrote:
One of the biggest change from I2C spec v6 -> v7 is:

   • Updated the terms "master/slave" to "controller/target"

Since it follows the inclusive terminology from the "Conscious
Language in your Open Source Projects" guidelines [*], replace
the I2C terminology.

Mechanical transformation running:

   $ cat i2c_rename.txt | while read old new; do \
       sed -i -e "s/$old/$new/g" $(git grep -l $old); \
     done

Having:

   $ cat i2c_rename.txt
   i2c_bus_master i2c_bus_controller
   i2c_schedule_pending_master i2c_schedule_pending_controller
   I2CPendingMasters I2CPendingControllers
   I2CPendingMaster I2CPendingController
   pending_masters pending_controllers
   I2C_SLAVE_CLASS I2C_TARGET_CLASS
   I2C_SLAVE_GET_CLASS I2C_TARGET_GET_CLASS
   I2CSlaveClass I2CTargetClass
   I2CSlave I2CTarget
   TYPE_I2C_SLAVE TYPE_I2C_TARGET
   I2C_SLAVE I2C_TARGET
   i2c_slave_new i2c_target_new
   i2c_slave_create_simple i2c_target_create_simple
   i2c_slave_realize_and_unref i2c_target_realize_and_unref
   i2c_slave_set_address i2c_target_set_address
   VMSTATE_I2C_SLAVE VMSTATE_I2C_TARGET
   vmstate_i2c_slave vmstate_i2c_target

Note, the QOM type definition is not modified, TYPE_I2C_TARGET
remains defined as "i2c-slave".

[*] https://github.com/conscious-lang/conscious-lang-docs/blob/main/faq.md

Inspired-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
...
@@ -649,29 +649,29 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState 
*bmc)
          qdev_connect_gpio_out(dev, pca1_leds[i].gpio_id,
                                qdev_get_gpio_in(DEVICE(led), 0));
      }
-    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 3),
+    i2c_target_create_simple(aspeed_i2c_get_bus(&soc->i2c, 3),
                             "dps310", 0x76);

So the location of the opening parenthesis changes in a lot of lines in your patch, but you don't adapt the following line accordingly, so the indentation is off now. ==> One more reason for not breaking the long lines in your previous patch.

 Thomas


Reply via email to