Skip to contentSkip to conversation

staging: fbtft: fix NULL comparison checkpatch warning

PATCH New Carlos Palminha 1 participant 1 message Sep 29, 2016

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

PATCH 1/1 staging: fbtft: fix NULL comparison checkpatch warning

Fixed the following checkpatch warnings (task #10 of eudyptula challenge):
- NULL comparison rewritten to use '!' operator

---
 drivers/staging/fbtft/fbtft_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fbtft_device.c +2 -2
index e9f25dd..e921183 100644
@@ -1418,14 +1418,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;
Signature · 1 line
2.9.3