From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] S3C24xx: Remove variable type size restrictions
Date: Mon, 18 Oct 2010 18:55:34 +0200 [thread overview]
Message-ID: <201010181855.34960.jbe@pengutronix.de> (raw)
From: Juergen Beisert <juergen@kreuzholzen.de>
Subject: [PATCH] S3C24xx: Remove variable type size restrictions
There is no need to restrict the size of the variables for the clock calculation
routines. So, remove and replace them by generic types.
Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
---
arch/arm/mach-s3c24xx/generic.c | 29 ++++++++++---------
arch/arm/mach-s3c24xx/include/mach/s3c24xx-generic.h | 14 ++++-----
2 files changed, 23 insertions(+), 20 deletions(-)
Index: barebox-2010.10.0/arch/arm/mach-s3c24xx/generic.c
===================================================================
--- barebox-2010.10.0.orig/arch/arm/mach-s3c24xx/generic.c
+++ barebox-2010.10.0/arch/arm/mach-s3c24xx/generic.c
@@ -33,9 +33,10 @@
* Calculate the current M-PLL clock.
* @return Current frequency in Hz
*/
-uint32_t s3c24xx_get_mpllclk(void)
+unsigned s3c24xx_get_mpllclk(void)
{
- uint32_t m, p, s, reg_val;
+ uint32_t reg_val;
+ unsigned m, p, s;
reg_val = readl(MPLLCON);
m = ((reg_val & 0xFF000) >> 12) + 8;
@@ -53,9 +54,10 @@ uint32_t s3c24xx_get_mpllclk(void)
* Calculate the current U-PLL clock
* @return Current frequency in Hz
*/
-uint32_t s3c24xx_get_upllclk(void)
+unsigned s3c24xx_get_upllclk(void)
{
- uint32_t m, p, s, reg_val;
+ uint32_t reg_val;
+ unsigned m, p, s;
reg_val = readl(UPLLCON);
m = ((reg_val & 0xFF000) >> 12) + 8;
@@ -69,7 +71,7 @@ uint32_t s3c24xx_get_upllclk(void)
* Calculate the FCLK frequency used for the ARM CPU core
* @return Current frequency in Hz
*/
-uint32_t s3c24xx_get_fclk(void)
+unsigned s3c24xx_get_fclk(void)
{
return s3c24xx_get_mpllclk();
}
@@ -78,9 +80,9 @@ uint32_t s3c24xx_get_fclk(void)
* Calculate the HCLK frequency used for the AHB bus (CPU to main peripheral)
* @return Current frequency in Hz
*/
-uint32_t s3c24xx_get_hclk(void)
+unsigned s3c24xx_get_hclk(void)
{
- uint32_t f_clk;
+ unsigned f_clk;
f_clk = s3c24xx_get_fclk();
#ifdef CONFIG_CPU_S3C2410
@@ -104,9 +106,9 @@ uint32_t s3c24xx_get_hclk(void)
* Calculate the PCLK frequency used for the slower peripherals
* @return Current frequency in Hz
*/
-uint32_t s3c24xx_get_pclk(void)
+unsigned s3c24xx_get_pclk(void)
{
- uint32_t p_clk;
+ unsigned p_clk;
p_clk = s3c24xx_get_hclk();
if (readl(CLKDIVN) & 0x01)
@@ -118,7 +120,7 @@ uint32_t s3c24xx_get_pclk(void)
* Calculate the UCLK frequency used by the USB host device
* @return Current frequency in Hz
*/
-uint32_t s3c24xx_get_uclk(void)
+unsigned s3c24xx_get_uclk(void)
{
return s3c24xx_get_upllclk();
}
@@ -127,9 +129,10 @@ uint32_t s3c24xx_get_uclk(void)
* Calculate the amount of connected and available memory
* @return Memory size in bytes
*/
-uint32_t s3c24x0_get_memory_size(void)
+unsigned s3c24x0_get_memory_size(void)
{
- uint32_t reg, size;
+ uint32_t reg;
+ unsigned size;
/*
* detect the current memory size
@@ -202,7 +205,7 @@ static struct clocksource cs = {
static int clocksource_init (void)
{
- uint32_t p_clk = s3c24xx_get_pclk();
+ unsigned p_clk = s3c24xx_get_pclk();
writel(0x00000000, TCON); /* stop all timers */
writel(0x00ffffff, TCFG0); /* PCLK / (255 + 1) for timer 4 */
Index: barebox-2010.10.0/arch/arm/mach-s3c24xx/include/mach/s3c24xx-generic.h
===================================================================
--- barebox-2010.10.0.orig/arch/arm/mach-s3c24xx/include/mach/s3c24xx-generic.h
+++ barebox-2010.10.0/arch/arm/mach-s3c24xx/include/mach/s3c24xx-generic.h
@@ -24,10 +24,10 @@
* MA 02111-1307 USA
*/
-uint32_t s3c24xx_get_mpllclk(void);
-uint32_t s3c24xx_get_upllclk(void);
-uint32_t s3c24xx_get_fclk(void);
-uint32_t s3c24xx_get_hclk(void);
-uint32_t s3c24xx_get_pclk(void);
-uint32_t s3c24xx_get_uclk(void);
-uint32_t s3c24x0_get_memory_size(void);
+unsigned s3c24xx_get_mpllclk(void);
+unsigned s3c24xx_get_upllclk(void);
+unsigned s3c24xx_get_fclk(void);
+unsigned s3c24xx_get_hclk(void);
+unsigned s3c24xx_get_pclk(void);
+unsigned s3c24xx_get_uclk(void);
+unsigned s3c24x0_get_memory_size(void);
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2010-10-18 16:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201010181855.34960.jbe@pengutronix.de \
--to=jbe@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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