HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33062
Change subject: soc/mediatek/mt8173/i2c.c: Remove variable set but not used ......................................................................
soc/mediatek/mt8173/i2c.c: Remove variable set but not used
Change-Id: I52d841aed31ce6d447280c75c1a1e7a08d8e0ca2 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/soc/mediatek/mt8173/i2c.c 1 file changed, 15 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/33062/1
diff --git a/src/soc/mediatek/mt8173/i2c.c b/src/soc/mediatek/mt8173/i2c.c index 3395539..c09eeb1 100644 --- a/src/soc/mediatek/mt8173/i2c.c +++ b/src/soc/mediatek/mt8173/i2c.c @@ -111,30 +111,26 @@
static inline void mtk_i2c_dump_info(uint8_t bus) { - struct mt8173_i2c_regs *regs; - - regs = i2c[bus].i2c_regs; - I2CLOG("I2C register:\nSLAVE_ADDR %x\nINTR_MASK %x\nINTR_STAT %x\n" "CONTROL %x\nTRANSFER_LEN %x\nTRANSAC_LEN %x\nDELAY_LEN %x\n" "TIMING %x\nSTART %x\nFIFO_STAT %x\nIO_CONFIG %x\nHS %x\n" "DEBUGSTAT %x\nEXT_CONF %x\n", - (read32(®s->salve_addr)), - (read32(®s->intr_mask)), - (read32(®s->intr_stat)), - (read32(®s->control)), - (read32(®s->transfer_len)), - (read32(®s->transac_len)), - (read32(®s->delay_len)), - (read32(®s->timing)), - (read32(®s->start)), - (read32(®s->fifo_stat)), - (read32(®s->io_config)), - (read32(®s->hs)), - (read32(®s->debug_stat)), - (read32(®s->ext_conf))); + (read32(&i2c[bus].i2c_regs->salve_addr)), + (read32(&i2c[bus].i2c_regs->intr_mask)), + (read32(&i2c[bus].i2c_regs->intr_stat)), + (read32(&i2c[bus].i2c_regs->control)), + (read32(&i2c[bus].i2c_regs->transfer_len)), + (read32(&i2c[bus].i2c_regs->transac_len)), + (read32(&i2c[bus].i2c_regs->delay_len)), + (read32(&i2c[bus].i2c_regs->timing)), + (read32(&i2c[bus].i2c_regs->start)), + (read32(&i2c[bus].i2c_regs->fifo_stat)), + (read32(&i2c[bus].i2c_regs->io_config)), + (read32(&i2c[bus].i2c_regs->hs)), + (read32(&i2c[bus].i2c_regs->debug_stat)), + (read32(&i2c[bus].i2c_regs->ext_conf)));
- I2CLOG("addr address %x\n", (uint32_t)regs); + I2CLOG("addr address %x\n", (uint32_t)i2c[bus].i2c_regs); }
static uint32_t mtk_i2c_transfer(uint8_t bus, struct i2c_msg *seg,
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33062 )
Change subject: soc/mediatek/mt8173/i2c.c: Remove variable set but not used ......................................................................
Patch Set 3: Code-Review-1
(1 comment)
I don't understand this. We might have a very different interpretation of "used".
Beside decreasing readability, I don't see what this change has to offer. Is this about some compiler or automatic tool reporting it? I assume it would be really unused depending on the definition of I2CLOG(). There might be multiple ways to work around: 1. make the variable a constant, and hope that nothing complains anymore. 2. define I2CLOG() such that the code is always compiled.
https://review.coreboot.org/#/c/33062/3/src/soc/mediatek/mt8173/i2c.c File src/soc/mediatek/mt8173/i2c.c:
https://review.coreboot.org/#/c/33062/3/src/soc/mediatek/mt8173/i2c.c@a122 PS3, Line 122: It was used here. I assume to enhance readability.
HAOUAS Elyes has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/33062 )
Change subject: soc/mediatek/mt8173/i2c.c: Remove variable set but not used ......................................................................
Abandoned