mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH 2/3] staging: fbtft: do not use magic numbers
Date: Sat,  5 Sep 2015 19:13:44 +0530	[thread overview]
Message-ID: <1441460625-19026-2-git-send-email-sudipm.mukherjee@gmail.com> (raw)
In-Reply-To: <1441460625-19026-1-git-send-email-sudipm.mukherjee@gmail.com>

Using magic numbers are not good coding practise. Use
FBTFT_GPIO_NAME_SIZE as defined in the header files.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/staging/fbtft/fbtft_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c b/drivers/staging/fbtft/fbtft_device.c
index 3856c88..80ab918 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1375,7 +1375,7 @@ static int __init fbtft_device_init(void)
 	}
 
 	/* name=list lists all supported displays */
-	if (strncmp(name, "list", 32) == 0) {
+	if (strncmp(name, "list", FBTFT_GPIO_NAME_SIZE) == 0) {
 		pr_info(DRVNAME":  Supported displays:\n");
 
 		for (i = 0; i < ARRAY_SIZE(displays); i++)
-- 
1.9.1


  reply	other threads:[~2015-09-05 13:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05 13:43 [PATCH 1/3] staging: fbtft: use strncpy instead of strcpy Sudip Mukherjee
2015-09-05 13:43 ` Sudip Mukherjee [this message]
2015-09-05 13:43 ` [PATCH 3/3] staging: fbtft: use pr_fmt Sudip Mukherjee
2015-09-09 18:35   ` Greg Kroah-Hartman
2015-09-09 21:20     ` Noralf Trønnes
2015-09-10  4:54       ` Sudip Mukherjee
2015-09-10 16:45         ` Noralf Trønnes
2015-09-11 10:38           ` Sudip Mukherjee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441460625-19026-2-git-send-email-sudipm.mukherjee@gmail.com \
    --to=sudipm.mukherjee@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®