[PATCH 4/4] Use the condition rather than a goto

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

 



Here it seems better just to invert the condition, then the
jump isn't needed.

---
 drivers/gpu/drm/omapdrm/omap_gem.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 907154f..02d93d7 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -557,22 +557,19 @@ int omap_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 
 	/* if a shmem backed object, make sure we have pages attached now */
 	ret = get_pages(obj, &pages);
-	if (ret)
-		goto fail;
-
-	/* where should we do corresponding put_pages().. we are mapping
-	 * the original page, rather than thru a GART, so we can't rely
-	 * on eviction to trigger this.  But munmap() or all mappings should
-	 * probably trigger put_pages()?
-	 */
-
-	if (omap_obj->flags & OMAP_BO_TILED)
-		ret = fault_2d(obj, vma, vmf);
-	else
-		ret = fault_1d(obj, vma, vmf);
+	if (!ret) {
+		/* where should we do corresponding put_pages().. we are mapping
+		 * the original page, rather than thru a GART, so we can't rely
+		 * on eviction to trigger this.  But munmap() or all mappings should
+		 * probably trigger put_pages()?
+		 */
 
+		if (omap_obj->flags & OMAP_BO_TILED)
+			ret = fault_2d(obj, vma, vmf);
+		else
+			ret = fault_1d(obj, vma, vmf);
+	}
 
-fail:
 	mutex_unlock(&dev->struct_mutex);
 	switch (ret) {
 	case 0:
-- 
2.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux