diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 11:50:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 11:50:40 -0400 |
commit | 80104bb06b17497b570b11a187131dca7d445b40 (patch) | |
tree | 6fb56513c6a32e3ac7cfc7f8d2babea3c33e7793 | |
parent | 78ee8b1b9b2fa1b51c51c42f3cffa0e12ad5f0ab (diff) | |
parent | 476c7e1d34f2a03b1aa5a924c50703053fe5f77c (diff) |
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()
-rw-r--r-- | drivers/i3c/master.c | 5 | ||||
-rw-r--r-- | drivers/i3c/master/dw-i3c-master.c | 10 |
2 files changed, 3 insertions, 12 deletions
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 1412abcff010..5f4bd52121fe 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c | |||
@@ -385,8 +385,9 @@ static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr, | |||
385 | return; | 385 | return; |
386 | 386 | ||
387 | ptr = bus->addrslots + (bitpos / BITS_PER_LONG); | 387 | ptr = bus->addrslots + (bitpos / BITS_PER_LONG); |
388 | *ptr &= ~(I3C_ADDR_SLOT_STATUS_MASK << (bitpos % BITS_PER_LONG)); | 388 | *ptr &= ~((unsigned long)I3C_ADDR_SLOT_STATUS_MASK << |
389 | *ptr |= status << (bitpos % BITS_PER_LONG); | 389 | (bitpos % BITS_PER_LONG)); |
390 | *ptr |= (unsigned long)status << (bitpos % BITS_PER_LONG); | ||
390 | } | 391 | } |
391 | 392 | ||
392 | static bool i3c_bus_dev_addr_is_avail(struct i3c_bus *bus, u8 addr) | 393 | static bool i3c_bus_dev_addr_is_avail(struct i3c_bus *bus, u8 addr) |
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c index 10c26ffaa8ef..1d83c97431c7 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c | |||
@@ -841,11 +841,6 @@ static int dw_i3c_master_priv_xfers(struct i3c_dev_desc *dev, | |||
841 | return -ENOTSUPP; | 841 | return -ENOTSUPP; |
842 | 842 | ||
843 | for (i = 0; i < i3c_nxfers; i++) { | 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 | |||
848 | for (i = 0; i < i3c_nxfers; i++) { | ||
849 | if (i3c_xfers[i].rnw) | 844 | if (i3c_xfers[i].rnw) |
850 | nrxwords += DIV_ROUND_UP(i3c_xfers[i].len, 4); | 845 | nrxwords += DIV_ROUND_UP(i3c_xfers[i].len, 4); |
851 | else | 846 | else |
@@ -974,11 +969,6 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev, | |||
974 | return -ENOTSUPP; | 969 | return -ENOTSUPP; |
975 | 970 | ||
976 | for (i = 0; i < i2c_nxfers; i++) { | 971 | for (i = 0; i < i2c_nxfers; i++) { |
977 | if (i2c_xfers[i].len > COMMAND_PORT_ARG_DATA_LEN_MAX) | ||
978 | return -ENOTSUPP; | ||
979 | } | ||
980 | |||
981 | for (i = 0; i < i2c_nxfers; i++) { | ||
982 | if (i2c_xfers[i].flags & I2C_M_RD) | 972 | if (i2c_xfers[i].flags & I2C_M_RD) |
983 | nrxwords += DIV_ROUND_UP(i2c_xfers[i].len, 4); | 973 | nrxwords += DIV_ROUND_UP(i2c_xfers[i].len, 4); |
984 | else | 974 | else |