All of lore.kernel.org
 help / color / mirror / Atom feed
From: felipe.balbi@nokia.com
To: Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Subject: [RFC PATCH 08/37] cbus: don't type case when issuing read/write
Date: Wed,  7 Apr 2010 19:03:59 +0300	[thread overview]
Message-ID: <1270656268-7034-9-git-send-email-felipe.balbi@nokia.com> (raw)
In-Reply-To: <1270656268-7034-1-git-send-email-felipe.balbi@nokia.com>

From: Felipe Balbi <felipe.balbi@nokia.com>

avoid type casting, fix the types used.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 drivers/cbus/cbus.c  |    4 ++--
 drivers/cbus/cbus.h  |    4 ++--
 drivers/cbus/retu.c  |    6 +++---
 drivers/cbus/retu.h  |    6 +++---
 drivers/cbus/tahvo.c |    6 +++---
 drivers/cbus/tahvo.h |    6 +++---
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/cbus/cbus.c b/drivers/cbus/cbus.c
index 53b43e1..06ab81f 100644
--- a/drivers/cbus/cbus.c
+++ b/drivers/cbus/cbus.c
@@ -129,7 +129,7 @@ static int cbus_transfer(struct cbus_host *host, unsigned rw, unsigned dev,
 /*
  * Read a given register from the device
  */
-int cbus_read_reg(int dev, int reg)
+int cbus_read_reg(unsigned dev, unsigned reg)
 {
 	return cbus_transfer(cbus_host, CBUS_XFER_READ, dev, reg, 0);
 }
@@ -138,7 +138,7 @@ EXPORT_SYMBOL(cbus_read_reg);
 /*
  * Write to a given register of the device
  */
-int cbus_write_reg(int dev, int reg, int val)
+int cbus_write_reg(unsigned dev, unsigned reg, unsigned val)
 {
 	return cbus_transfer(cbus_host, CBUS_XFER_WRITE, dev, reg, val);
 }
diff --git a/drivers/cbus/cbus.h b/drivers/cbus/cbus.h
index fbaca09..62f1874 100644
--- a/drivers/cbus/cbus.h
+++ b/drivers/cbus/cbus.h
@@ -32,7 +32,7 @@ struct cbus_host {
 	int	sel_gpio;
 };
 
-extern int cbus_read_reg(int dev, int reg);
-extern int cbus_write_reg(int dev, int reg, int val);
+extern int cbus_read_reg(unsigned dev, unsigned reg);
+extern int cbus_write_reg(unsigned dev, unsigned reg, unsigned val);
 
 #endif /* __DRIVERS_CBUS_CBUS_H */
diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c
index 35fdd11..80a2acc 100644
--- a/drivers/cbus/retu.c
+++ b/drivers/cbus/retu.c
@@ -78,7 +78,7 @@ EXPORT_SYMBOL(retu_get_status);
  *
  * This function returns the contents of the specified register
  */
-int retu_read_reg(int reg)
+int retu_read_reg(unsigned reg)
 {
 	BUG_ON(!retu_initialized);
 	return cbus_read_reg(RETU_ID, reg);
@@ -91,13 +91,13 @@ int retu_read_reg(int reg)
  *
  * This function writes a value to the specified register
  */
-void retu_write_reg(int reg, u16 val)
+void retu_write_reg(unsigned reg, u16 val)
 {
 	BUG_ON(!retu_initialized);
 	cbus_write_reg(RETU_ID, reg, val);
 }
 
-void retu_set_clear_reg_bits(int reg, u16 set, u16 clear)
+void retu_set_clear_reg_bits(unsigned reg, u16 set, u16 clear)
 {
 	unsigned long flags;
 	u16 w;
diff --git a/drivers/cbus/retu.h b/drivers/cbus/retu.h
index fbd1981..cf3cf20 100644
--- a/drivers/cbus/retu.h
+++ b/drivers/cbus/retu.h
@@ -58,9 +58,9 @@
 #define	MAX_RETU_IRQ_HANDLERS	16
 
 int retu_get_status(void);
-int retu_read_reg(int reg);
-void retu_write_reg(int reg, u16 val);
-void retu_set_clear_reg_bits(int reg, u16 set, u16 clear);
+int retu_read_reg(unsigned reg);
+void retu_write_reg(unsigned reg, u16 val);
+void retu_set_clear_reg_bits(unsigned reg, u16 set, u16 clear);
 int retu_read_adc(int channel);
 int retu_request_irq(int id, void *irq_handler, unsigned long arg, char *name);
 void retu_free_irq(int id);
diff --git a/drivers/cbus/tahvo.c b/drivers/cbus/tahvo.c
index 6828acc..d8fa90a 100644
--- a/drivers/cbus/tahvo.c
+++ b/drivers/cbus/tahvo.c
@@ -78,7 +78,7 @@ EXPORT_SYMBOL(tahvo_get_status);
  *
  * This function returns the contents of the specified register
  */
-int tahvo_read_reg(int reg)
+int tahvo_read_reg(unsigned reg)
 {
 	BUG_ON(!tahvo_initialized);
 	return cbus_read_reg(TAHVO_ID, reg);
@@ -91,7 +91,7 @@ int tahvo_read_reg(int reg)
  *
  * This function writes a value to the specified register
  */
-void tahvo_write_reg(int reg, u16 val)
+void tahvo_write_reg(unsigned reg, u16 val)
 {
 	BUG_ON(!tahvo_initialized);
 	cbus_write_reg(TAHVO_ID, reg, val);
@@ -104,7 +104,7 @@ void tahvo_write_reg(int reg, u16 val)
  *
  * This function sets and clears the specified Tahvo register bits atomically
  */
-void tahvo_set_clear_reg_bits(int reg, u16 set, u16 clear)
+void tahvo_set_clear_reg_bits(unsigned reg, u16 set, u16 clear)
 {
 	unsigned long flags;
 	u16 w;
diff --git a/drivers/cbus/tahvo.h b/drivers/cbus/tahvo.h
index b4c6f50..97d6583 100644
--- a/drivers/cbus/tahvo.h
+++ b/drivers/cbus/tahvo.h
@@ -40,9 +40,9 @@
 #define MAX_TAHVO_IRQ_HANDLERS	8
 
 int tahvo_get_status(void);
-int tahvo_read_reg(int reg);
-void tahvo_write_reg(int reg, u16 val);
-void tahvo_set_clear_reg_bits(int reg, u16 set, u16 clear);
+int tahvo_read_reg(unsigned reg);
+void tahvo_write_reg(unsigned reg, u16 val);
+void tahvo_set_clear_reg_bits(unsigned reg, u16 set, u16 clear);
 int tahvo_request_irq(int id, void *irq_handler, unsigned long arg, char *name);
 void tahvo_free_irq(int id);
 void tahvo_enable_irq(int id);
-- 
1.7.0.rc0.33.g7c3932


  parent reply	other threads:[~2010-04-07 16:05 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07 16:03 [RFC PATCH 00/37] cbus patches felipe.balbi
2010-04-07 16:03 ` [RFC PATCH 01/37] cbus: convert u32 base to void __iomem *base felipe.balbi
2010-04-07 16:03 ` [RFC PATCH 02/37] cbus: NULL global variable on exit felipe.balbi
2010-04-07 16:03 ` [RFC PATCH 03/37] cbus: checkpatch.pl fix on cbus.c felipe.balbi
2010-04-07 16:03 ` [RFC PATCH 04/37] cbus: don't export the global cbus_host variable felipe.balbi
2010-04-07 16:03 ` [RFC PATCH 05/37] cbus: rely on gpiolib felipe.balbi
2010-04-07 16:03 ` [RFC PATCH 06/37] cbus: no ternary on return felipe.balbi
2010-04-07 16:03 ` [RFC PATCH 07/37] cbus: add read/write flag to cbus_transfer felipe.balbi
2010-04-07 16:03 ` felipe.balbi [this message]
2010-04-07 16:04 ` [RFC PATCH 09/37] cbus: fix a resource leakage felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 10/37] cbus: move cbus_host definition to C source felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 11/37] cbus: handle possible errors on cbus_send/receive_bit felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 12/37] cbus: introduce cbus_send/receive_data wrappers felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 13/37] cbus: add kerneldoc felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 14/37] cbus: retu-wdt: fix compile breakage felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 15/37] cbus: retu: fix compile breakage on retu-headset felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 16/37] cbus: retu: split one MODULE_AUTHOR into several felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 17/37] cbus: retu: don't assing ret inside the if () felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 18/37] cbus: retu: convert printk to dev_* felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 19/37] cbus: retu: convert to a platform_driver felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 20/37] cbus: tahvo: split MODULE_AUTHOR into several entries felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 21/37] cbus: tahvo: move EXPORT_SYMBOL macros closer to functions felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 22/37] cbus: tahvo: don't assign ret inside if () felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 23/37] cbus: tahvo: convert printk into dev_* felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 24/37] cbus: tahvo: convert to platform_driver felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 25/37] cbus: retu: allocate platform_device for Retu's children felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 26/37] cbus: retu-pwrbutton: convert to platform_driver felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 27/37] cbus: retu-headset: simplify module_init felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 28/37] cbus: retu-rtc: remove platform_device code felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 29/37] cbus: retu-rtc: convert to platform_driver felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 30/37] cbus: retu-rtc: split MODULE_AUTHOR into several entries felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 31/37] cbus: retu-rtc: get rid of globals felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 32/37] cbus: retu-rtc: move retu_rtc_barrier up on source code felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 33/37] cbus: retu-rtc: make checkpatch.pl happy felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 34/37] cbus: retu-rtc: switch to rtc class device felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 35/37] cbus: retu-wdt: remove the platform_device felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 36/37] cbus: retu-wtd: convert to platform_driver felipe.balbi
2010-04-07 16:04 ` [RFC PATCH 37/37] cbus: retu-wdt: misc cleanup on retu-wdt driver felipe.balbi
2010-04-08  9:23 ` [RFC PATCH 00/37] cbus patches Tony Lindgren
2010-04-24  0:45   ` Tony Lindgren
2010-04-26  5:25     ` Felipe Balbi

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=1270656268-7034-9-git-send-email-felipe.balbi@nokia.com \
    --to=felipe.balbi@nokia.com \
    --cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.