[PATCH] staging: fbtft: Use strcmp instead of strncmp

Ravindran, Madhusudhanan (M.) mravindr at visteon.com
Wed Mar 18 17:29:26 UTC 2015


Since both buffers are null terminated, strncmp
is not needed.

Signed-off-by: Madhusudhanan Ravindran <mravindr at visteon.com>
---
 drivers/staging/fbtft/fbtft_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c b/drivers/staging/fbtft/fbtft_device.c
index 1afeebb..ee21607 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1334,7 +1334,7 @@ static int __init fbtft_device_init(void)
 	}
 
 	/* name=list lists all supported displays */
-	if (strncmp(name, "list", 32) == 0) {
+	if (strcmp(name, "list") == 0) {
 		pr_info(DRVNAME":  Supported displays:\n");
 
 		for (i = 0; i < ARRAY_SIZE(displays); i++)
@@ -1355,7 +1355,7 @@ static int __init fbtft_device_init(void)
 	}
 
 	for (i = 0; i < ARRAY_SIZE(displays); i++) {
-		if (strncmp(name, displays[i].name, 32) == 0) {
+		if (strcmp(name, displays[i].name) == 0) {
 			if (displays[i].spi) {
 				spi = displays[i].spi;
 				spi->chip_select = cs;
-- 
1.9.1


More information about the devel mailing list