Skip to contentSkip to conversation

staging: fbtft: Fix checkpatch warning

PATCH In review Carlos Palminha 2 participants 2 messages Sep 29, 2016

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

PATCH v3 1/1 staging: fbtft: Fix checkpatch warning

Fixed the following checkpatch warnings (task #10 of eudyptula challenge):
- removed unnecessary blank line after open brace
- NULL comparison rewritten to use '!' operator

---
Changes v2->v3:
- Improved explanation text.
Changes v1->v2:
- Added signed-off-by and comment.

 drivers/staging/fbtft/fbtft_device.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/fbtft/fbtft_device.c +2 -4
index e9f25dd..0883715 100644
@@ -841,7 +841,6 @@ static struct fbtft_device_display displays[] = {
 			}
 		}
 	}, {
-
 		.name = "piscreen",
 		.spi = &(struct spi_board_info) {
 			.modalias = "fb_ili9486",
@@ -1418,14 +1417,14 @@ static int __init fbtft_device_init(void)
 
 	/* parse module parameter: gpios */
 	while ((p_gpio = strsep(&gpios, ","))) {
-		if (strchr(p_gpio, ':') == NULL) {
+		if (!strchr(p_gpio, ':')) {
 			pr_err("error: missing ':' in gpios parameter: %s\n",
 			       p_gpio);
 			return -EINVAL;
 		}
 		p_num = p_gpio;
 		p_name = strsep(&p_num, ":");
-		if (p_name == NULL || p_num == NULL) {
+		if (!p_name || !p_num) {
 			pr_err("something bad happened parsing gpios parameter: %s\n",
 			       p_gpio);
 			return -EINVAL;
@@ -1586,7 +1585,6 @@ static void __exit fbtft_device_exit(void)
 
 	if (p_device)
 		platform_device_unregister(p_device);
-
 }
 
 arch_initcall(fbtft_device_init);
Signature · 1 line
2.9.3
maintainer
#1 lore raw
Quoted 3 lines · Carlos Palminha

Fixed the following checkpatch warnings (task #10 of eudyptula challenge):
- removed unnecessary blank line after open brace
- NULL comparison rewritten to use '!' operator

That is two totally different things, this requires 2 totally different patches. I thought I hinted at that previously...

thanks,

greg k-h