Skip to contentSkip to conversation

drm/drm_bufs.c: In switch, add break in default case

PATCH Applied Fabio M. De Francesco 2 participants 2 messages Apr 17, 2021 – Apr 20, 2021

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

PATCH v2 1/1 drm/drm_bufs.c: In switch, add break in default case

Added a "break" in the default case of a switch select statement. GCC complains, although this "break" is not strictly necessary for the code to work as expected.

---

Changes from v1: Added the reason why of this change in the log.

 drivers/gpu/drm/drm_bufs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_bufs.c +1 -1
index e3d77dfefb0a..fc40aa0adf73 100644
@@ -79,7 +79,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
 				return entry;
 			break;
 		default: /* Make gcc happy */
-			;
+			break;
 		}
 		if (entry->map->offset == map->offset)
 			return entry;
Signature · 1 line
2.31.1
#1 lore raw
Quoted 3 lines · Fabio M. De Francesco

Added a "break" in the default case of a switch select statement. GCC complains, although this "break" is not strictly necessary for the code to work as expected.

Luckily we already have a comment stating that this is all just to make gcc happy.

Quoted 2 lines

Applied to drm-misc-next, thanks for the patch.
-Daniel

Quoted 23 lines

---

Changes from v1: Added the reason why of this change in the log.

 drivers/gpu/drm/drm_bufs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_bufs.c +1 -1
index e3d77dfefb0a..fc40aa0adf73 100644
@@ -79,7 +79,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
 				return entry;
 			break;
 		default: /* Make gcc happy */
-			;
+			break;
 		}
 		if (entry->map->offset == map->offset)
 			return entry;
Signature · 1 line
2.31.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch