Patch "i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS" has been added to the 6.1-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i3c-master-replace-hard-code-2-with-macro-i3c_addr_s.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a11955e7df9dbf331744da5f00506be4d2759e0b
Author: Frank Li <Frank.Li@xxxxxxx>
Date:   Mon Oct 21 11:45:06 2024 -0400

    i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS
    
    [ Upstream commit 16aed0a6520ba01b7d22c32e193fc1ec674f92d4 ]
    
    Replace the hardcoded value 2, which indicates 2 bits for I3C address
    status, with the predefined macro I3C_ADDR_SLOT_STATUS_BITS.
    
    Improve maintainability and extensibility of the code.
    
    Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
    Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
    Link: https://lore.kernel.org/r/20241021-i3c_dts_assign-v8-1-4098b8bde01e@xxxxxxx
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
    Stable-dep-of: 851bd21cdb55 ("i3c: master: Fix dynamic address leak when 'assigned-address' is present")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 103d3383e176d..621881b6bf81c 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -344,7 +344,7 @@ static enum i3c_addr_slot_status
 i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr)
 {
 	unsigned long status;
-	int bitpos = addr * 2;
+	int bitpos = addr * I3C_ADDR_SLOT_STATUS_BITS;
 
 	if (addr > I2C_MAX_ADDR)
 		return I3C_ADDR_SLOT_RSVD;
@@ -358,7 +358,7 @@ i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr)
 static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr,
 					 enum i3c_addr_slot_status status)
 {
-	int bitpos = addr * 2;
+	int bitpos = addr * I3C_ADDR_SLOT_STATUS_BITS;
 	unsigned long *ptr;
 
 	if (addr > I2C_MAX_ADDR)
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index 585b6c509802d..706a583c45efc 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -304,6 +304,8 @@ enum i3c_addr_slot_status {
 	I3C_ADDR_SLOT_STATUS_MASK = 3,
 };
 
+#define I3C_ADDR_SLOT_STATUS_BITS 2
+
 /**
  * struct i3c_bus - I3C bus object
  * @cur_master: I3C master currently driving the bus. Since I3C is multi-master
@@ -345,7 +347,7 @@ enum i3c_addr_slot_status {
 struct i3c_bus {
 	struct i3c_dev_desc *cur_master;
 	int id;
-	unsigned long addrslots[((I2C_MAX_ADDR + 1) * 2) / BITS_PER_LONG];
+	unsigned long addrslots[((I2C_MAX_ADDR + 1) * I3C_ADDR_SLOT_STATUS_BITS) / BITS_PER_LONG];
 	enum i3c_bus_mode mode;
 	struct {
 		unsigned long i3c;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux