Skip to contentSkip to conversation

drm: aspeed: Fix GENMASK misuse

PATCH In review Ondrej Jirman 3 participants 3 messages Feb 22, 2020 – Oct 9, 2020

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

PATCH 1/1 drm: aspeed: Fix GENMASK misuse

Arguments to GENMASK should be msb >= lsb.

---
I just grepped the whole kernel tree for GENMASK argument order issues, and this is one of the three that popped up. No testing was done.

 drivers/gpu/drm/aspeed/aspeed_gfx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/aspeed/aspeed_gfx.h +1 -1
index a10358bb61ec4..095ea03e5833c 100644
@@ -74,7 +74,7 @@ int aspeed_gfx_create_output(struct drm_device *drm);
 /* CTRL2 */
 #define CRT_CTRL_DAC_EN			BIT(0)
 #define CRT_CTRL_VBLANK_LINE(x)		(((x) << 20) & CRT_CTRL_VBLANK_LINE_MASK)
-#define CRT_CTRL_VBLANK_LINE_MASK	GENMASK(20, 31)
+#define CRT_CTRL_VBLANK_LINE_MASK	GENMASK(31, 20)
 
 /* CRT_HORIZ0 */
 #define CRT_H_TOTAL(x)			(x)
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ondrej Jirman

Arguments to GENMASK should be msb >= lsb.

---
I just grepped the whole kernel tree for GENMASK argument order issues, and this is one of the three that popped up. No testing was done.

I think someone's sent a patch previously, and last time it turned into a discussion about how the macros aren't actually used and could be removed.

Regardless:

maintainer
#2 lore raw
Quoted 11 lines · Andrew Jeffery
Quoted 6 lines · Ondrej Jirman

Arguments to GENMASK should be msb >= lsb.

---
I just grepped the whole kernel tree for GENMASK argument order issues, and this is one of the three that popped up. No testing was done.

Quoted 7 lines

I think someone's sent a patch previously, and last time it turned into a discussion about how the macros aren't actually used and could be removed.

Regardless:

Thanks, I've applied this to drm-misc-next. Apologies for the delay.