Re: [RFC 3/7] staging: fbtft: add lcd controller abstraction

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

 




Den 03.03.2015 13:04, skrev Dan Carpenter:
On Tue, Mar 03, 2015 at 12:57:29PM +0100, Noralf Trønnes wrote:
+	ret = ctrl->rotate(ctrl, rotation);
+	if (!ret)
+		ctrl->rotation = rotation;
+
+	return ret;
Better to check "if (ret)" consistently (error handling vs success
handling).
Like this?

	ret = ctrl->rotate(ctrl, rotation);
	if (ret)
		return ret;

	ctrl->rotation = rotation;

	return 0;

Yeah.  This is a tiny nit.  I feel a bit silly for commenting on it now.

No need to be. If this enhances readability even just a tiny bit, I welcome it. I've read enough kernel code now to be amazed of how readable and understandable it is. This becomes very evident when reading some out-of-tree drivers, and *cough* fbtft. I'm practically blind to the code in this patchset, as it has gone through several iterations over the past months. To me it looks very good, but obviously not without room for
improvements :-)


Noralf.

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux