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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1360691872-2848-1-git-send-email-wpawel@gmail.com>
Date:	Tue, 12 Feb 2013 18:57:52 +0100
From:	Pawel Wieczorkiewicz <wpawel@...il.com>
To:	a.zummo@...ertech.it
Cc:	rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org,
	Pawel Wieczorkiewicz <wpawel@...il.com>
Subject: [PATCH 1/1] rtc-proc: replace "rtcN" name creation with dev_name() call

From: Pawel Wieczorkiewicz <wpawel@...il.com>

Instead of creating rtc device name basing on rtc->id in
local array, make use of existing one using dev_name() call
to compare against CONFIG_RTC_HCTOSYS_DEVICE.

Signed-off-by: Pawel Wieczorkiewicz <wpawel@...il.com>
---
 drivers/rtc/rtc-proc.c |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
index e96236a..473d017 100644
--- a/drivers/rtc/rtc-proc.c
+++ b/drivers/rtc/rtc-proc.c
@@ -18,22 +18,13 @@
 
 #include "rtc-core.h"
 
-#define NAME_SIZE	10
-
 #if defined(CONFIG_RTC_HCTOSYS_DEVICE)
-static bool is_rtc_hctosys(struct rtc_device *rtc)
+static inline bool is_rtc_hctosys(struct rtc_device *rtc)
 {
-	int size;
-	char name[NAME_SIZE];
-
-	size = scnprintf(name, NAME_SIZE, "rtc%d", rtc->id);
-	if (size > NAME_SIZE)
-		return false;
-
-	return !strncmp(name, CONFIG_RTC_HCTOSYS_DEVICE, NAME_SIZE);
+	return !strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE);
 }
 #else
-static bool is_rtc_hctosys(struct rtc_device *rtc)
+static inline bool is_rtc_hctosys(struct rtc_device *rtc)
 {
 	return (rtc->id == 0);
 }
-- 
1.7.9.5

--
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