Skip to content

Commit 80104bb

Browse files
committed
Merge tag 'i3c/for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux
Pull i3c update from Boris Brezillon: - Fix a shift wrap bug in the core - Remove dead code in the DW driver * tag 'i3c/for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: Fix a shift wrap bug in i3c_bus_set_addr_slot_status() i3c: master: dw: remove dead code from dw_i3c_master_*_xfers()
2 parents 78ee8b1 + 476c7e1 commit 80104bb

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

drivers/i3c/master.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,9 @@ static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr,
385385
return;
386386

387387
ptr = bus->addrslots + (bitpos / BITS_PER_LONG);
388-
*ptr &= ~(I3C_ADDR_SLOT_STATUS_MASK << (bitpos % BITS_PER_LONG));
389-
*ptr |= status << (bitpos % BITS_PER_LONG);
388+
*ptr &= ~((unsigned long)I3C_ADDR_SLOT_STATUS_MASK <<
389+
(bitpos % BITS_PER_LONG));
390+
*ptr |= (unsigned long)status << (bitpos % BITS_PER_LONG);
390391
}
391392

392393
static bool i3c_bus_dev_addr_is_avail(struct i3c_bus *bus, u8 addr)

drivers/i3c/master/dw-i3c-master.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,6 @@ static int dw_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
840840
if (i3c_nxfers > master->caps.cmdfifodepth)
841841
return -ENOTSUPP;
842842

843-
for (i = 0; i < i3c_nxfers; i++) {
844-
if (i3c_xfers[i].len > COMMAND_PORT_ARG_DATA_LEN_MAX)
845-
return -ENOTSUPP;
846-
}
847-
848843
for (i = 0; i < i3c_nxfers; i++) {
849844
if (i3c_xfers[i].rnw)
850845
nrxwords += DIV_ROUND_UP(i3c_xfers[i].len, 4);
@@ -973,11 +968,6 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
973968
if (i2c_nxfers > master->caps.cmdfifodepth)
974969
return -ENOTSUPP;
975970

976-
for (i = 0; i < i2c_nxfers; i++) {
977-
if (i2c_xfers[i].len > COMMAND_PORT_ARG_DATA_LEN_MAX)
978-
return -ENOTSUPP;
979-
}
980-
981971
for (i = 0; i < i2c_nxfers; i++) {
982972
if (i2c_xfers[i].flags & I2C_M_RD)
983973
nrxwords += DIV_ROUND_UP(i2c_xfers[i].len, 4);

0 commit comments

Comments
 (0)