Skip to contentSkip to conversation

auxdisplay: panel: replace struct with union for display configuration

PATCH In review Atharva Tiwari 3 participants 4 messages Dec 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 auxdisplay: panel: replace struct with union for display configuration

this patch replaces a struct with a union in the panel.c driver to better represent display configuration as mentioned in TODO

---
 drivers/auxdisplay/panel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/auxdisplay/panel.c +1 -2
index a731f28455b4..4662f763dac7 100644
@@ -204,8 +204,7 @@ static struct {
 	int charset;
 	int proto;
 
-	/* TODO: use union here? */
-	struct {
+	union {
 		int e;
 		int rs;
 		int rw;
Signature · 1 line
2.39.5
#1 lore raw

Hello!

Quoted 13 lines · Atharva Tiwari

this patch replaces a struct with a union in the panel.c driver to better represent display configuration as mentioned in TODO

---
 drivers/auxdisplay/panel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/auxdisplay/panel.c +0 -0
index a731f28455b4..4662f763dac7 100644

drivers/auxdisplay/panel.c static struct { · line 210

Quoted 9 lines
drivers/auxdisplay/panel.c +1 -2
@@ -204,8 +204,7 @@ static struct {
 	int charset;
 	int proto;
 
-	/* TODO: use union here? */
-	struct {
+	union {
 		int e;
 		int rs;
 		int rw;

Have you tested this patch ? I guess not. The TODO here is not just to change a language keyword but to see if it would be better achieved using a different construct and representation of the different signals. Here what you've done is merge all the signals into a single one.

I think that a better patch would be to just remove the TODO comment that has been there for about 20 years without making any progress, and which is no longer relevant since that code will not change now.

regards,
Willy

#2 lore raw

PATCH 1/1 auxdisplay: panel: replace struct with union for display configuration

Well as you said it was better to just remove the todo that just what i did :)

---
 drivers/auxdisplay/panel.c | 1 +--
 1 file changed, 1 deletions(-)
drivers/auxdisplay/panel.c +0 -1
index a731f28455b4..4662f763dac7 100644
@@ -204,8 +204,7 @@ static struct {
 	int charset;
 	int proto;
 
-	/* TODO: use union here? */
 		int e;
 		int rs;
 		int rw;
Signature · 1 line
2.39.5
#3 lore raw
Quoted 3 lines · Atharva Tiwari

Well as you said it was better to just remove the todo that just what i did :)

Please, follow the "Submitting Patches" and "Linux Kernel patch submission checklist" documentation and try again after studying that.

Signature · 2 lines
With Best Regards,
Andy Shevchenko