lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1347891173-13916-3-git-send-email-jmunhoz@igalia.com>
Date:	Mon, 17 Sep 2012 16:12:48 +0200
From:	"Javier M. Mellid" <jmunhoz@...lia.com>
To:	gregkh@...uxfoundation.org, gewang@...iconmotion.com
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	"Javier M. Mellid" <jmunhoz@...lia.com>
Subject: [PATCH 2/7] staging: sm7xxfb: clean smtcfb_fix's id initialization

From: "Javier M. Mellid" <jmunhoz@...lia.com>

Setting up smtcfb_fix's id happens through smtc_alloc_fb_info. It adds
complexity and unnecesary code.

Signed-off-by: Javier M. Mellid <jmunhoz@...lia.com>
---
 drivers/staging/sm7xxfb/sm7xxfb.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index b809e2c..f6ecac3 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -77,7 +77,7 @@ static struct fb_var_screeninfo smtcfb_var = {
 };
 
 static struct fb_fix_screeninfo smtcfb_fix = {
-	.id             = "sm712fb",
+	.id             = "smXXXfb",
 	.type           = FB_TYPE_PACKED_PIXELS,
 	.visual         = FB_VISUAL_TRUECOLOR,
 	.line_length    = 800 * 3,
@@ -681,7 +681,7 @@ static struct fb_ops smtcfb_ops = {
 /*
  * alloc struct smtcfb_info and assign the default value
  */
-static struct smtcfb_info *smtc_alloc_fb_info(struct pci_dev *pdev, char *name)
+static struct smtcfb_info *smtc_alloc_fb_info(struct pci_dev *pdev)
 {
 	struct smtcfb_info *sfb;
 
@@ -698,7 +698,6 @@ static struct smtcfb_info *smtc_alloc_fb_info(struct pci_dev *pdev, char *name)
 	sfb->fb.fbops = &smtcfb_ops;
 
 	sfb->fb.fix = smtcfb_fix;
-	strcpy(sfb->fb.fix.id, name);
 
 	sfb->fb.var = smtcfb_var;
 
@@ -781,7 +780,6 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
 {
 	struct smtcfb_info *sfb;
 	u_long smem_size = 0x00800000;	/* default 8MB */
-	char name[16];
 	int err;
 	unsigned long pFramebufferPhysical;
 
@@ -791,9 +789,9 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
 	if (err)
 		return err;
 
-	sprintf(name, "sm%Xfb", ent->device);
+	sprintf(smtcfb_fix.id, "sm%Xfb", ent->device);
 
-	sfb = smtc_alloc_fb_info(pdev, name);
+	sfb = smtc_alloc_fb_info(pdev);
 
 	if (!sfb) {
 		err = -ENOMEM;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ