Skip to contentSkip to conversation

gpio: virtuser: Use GPIO_LOOKUP_IDX() macro

PATCH Applied Andy Shevchenko 2 participants 2 messages Aug 20, 2024 – Aug 21, 2024 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: virtuser: Use GPIO_LOOKUP_IDX() macro

Use GPIO_LOOKUP_IDX() macro which provides a compound literal and can be used with dynamic data.

---
 drivers/gpio/gpio-virtuser.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/gpio/gpio-virtuser.c +4 -9
index ccc47ea0b3e1..91b6352c957c 100644
@@ -1410,7 +1410,6 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev)
 	size_t num_entries = gpio_virtuser_get_lookup_count(dev);
 	struct gpio_virtuser_lookup_entry *entry;
 	struct gpio_virtuser_lookup *lookup;
-	struct gpiod_lookup *curr;
 	unsigned int i = 0;
 
 	lockdep_assert_held(&dev->lock);
@@ -1426,14 +1425,10 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev)
 
 	list_for_each_entry(lookup, &dev->lookup_list, siblings) {
 		list_for_each_entry(entry, &lookup->entry_list, siblings) {
-			curr = &table->table[i];
-
-			curr->con_id = lookup->con_id;
-			curr->idx = i;
-			curr->key = entry->key;
-			curr->chip_hwnum = entry->offset < 0 ?
-						U16_MAX : entry->offset;
-			curr->flags = entry->flags;
+			table->table[i] =
+				GPIO_LOOKUP_IDX(entry->key,
+						entry->offset < 0 ? U16_MAX : entry->offset,
+						lookup->con_id, i, entry->flags);
 			i++;
 		}
 	}
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
#1 lore raw

From: Bartosz Golaszewski <[email protected]>

Quoted 4 lines · Andy Shevchenko

Use GPIO_LOOKUP_IDX() macro which provides a compound literal and can be used with dynamic data.

Applied, thanks!

[1/1] gpio: virtuser: Use GPIO_LOOKUP_IDX() macro

      commit: 2a4727e6a8bd1d2b8ae7abf95061eda0457c4d79

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>