qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/3] qtest: Add functions for accessing devices on Aspeed


From: Stefan Berger
Subject: Re: [PATCH v3 1/3] qtest: Add functions for accessing devices on Aspeed I2C controller
Date: Tue, 28 Mar 2023 13:17:52 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0



On 3/28/23 11:05, Thomas Huth wrote:
On 28/03/2023 15.51, Stefan Berger wrote:

+
+void aspeed_i2c_writeb(uint32_t baseaddr, uint8_t slave_addr,
+                       uint8_t reg, uint8_t v)
+{
+    aspeed_i2c_write_n(baseaddr, slave_addr, reg, v, sizeof(v));
+}

For helper functions like this, I'd recommend to not use libqtest-single.h and 
rather pass in a QTestState* as parameter to use qtest_writel() and 
qtest_readl() instead. That will make the code future-proof in case someone 
wants to use these function for migration-related tests later.

Done.


  Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]