From: Pavel Machek <pavel@ucw.cz>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "Marcel Holtmann" <marcel@holtmann.org>,
"Pali Rohár" <pali.rohar@gmail.com>,
"Miguel Oliveira" <cmroliv@gmail.com>,
gulsah.1004@gmail.com, peter.p.waskiewicz.jr@intel.com,
kristina.martsenko@gmail.com, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] staging: use inlines where it makes sense
Date: Sun, 10 Aug 2014 09:33:43 +0200 [thread overview]
Message-ID: <20140810073343.GC19735@amd.pavel.ucw.cz> (raw)
In-Reply-To: <20140807202407.GC6060@kroah.com>
Make some uart function static inline to reduce ammount of exported code.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
diff --git a/drivers/staging/nokia_h4p/hci_h4p.h b/drivers/staging/nokia_h4p/hci_h4p.h
index b91e8b3..6c72ca5 100644
--- a/drivers/staging/nokia_h4p/hci_h4p.h
+++ b/drivers/staging/nokia_h4p/hci_h4p.h
@@ -26,6 +26,8 @@
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/hci.h>
+#include <linux/serial_reg.h>
+
#define UART_SYSC_OMAP_RESET 0x03
#define UART_SYSS_RESETDONE 0x01
#define UART_OMAP_SCR_EMPTY_THR 0x08
@@ -205,9 +207,28 @@ int hci_h4p_read_fw(struct hci_h4p_info *info, struct sk_buff_head *fw_queue);
int hci_h4p_send_fw(struct hci_h4p_info *info, struct sk_buff_head *fw_queue);
void hci_h4p_parse_fw_event(struct hci_h4p_info *info, struct sk_buff *skb);
-void hci_h4p_outb(struct hci_h4p_info *info, unsigned int offset, u8 val);
-u8 hci_h4p_inb(struct hci_h4p_info *info, unsigned int offset);
-void hci_h4p_set_rts(struct hci_h4p_info *info, int active);
+static inline void hci_h4p_outb(struct hci_h4p_info *info, unsigned int offset, u8 val)
+{
+ __raw_writeb(val, info->uart_base + (offset << 2));
+}
+
+static inline u8 hci_h4p_inb(struct hci_h4p_info *info, unsigned int offset)
+{
+ return __raw_readb(info->uart_base + (offset << 2));
+}
+
+static inline void hci_h4p_set_rts(struct hci_h4p_info *info, int active)
+{
+ u8 b;
+
+ b = hci_h4p_inb(info, UART_MCR);
+ if (active)
+ b |= UART_MCR_RTS;
+ else
+ b &= ~UART_MCR_RTS;
+ hci_h4p_outb(info, UART_MCR, b);
+}
+
int hci_h4p_wait_for_cts(struct hci_h4p_info *info, int active, int timeout_ms);
void __hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which);
void hci_h4p_set_auto_ctsrts(struct hci_h4p_info *info, int on, u8 which);
diff --git a/drivers/staging/nokia_h4p/nokia_uart.c b/drivers/staging/nokia_h4p/nokia_uart.c
index 0fb57de..9aab7bb 100644
--- a/drivers/staging/nokia_h4p/nokia_uart.c
+++ b/drivers/staging/nokia_h4p/nokia_uart.c
@@ -19,7 +19,6 @@
*
*/
-#include <linux/serial_reg.h>
#include <linux/delay.h>
#include <linux/clk.h>
@@ -27,27 +26,7 @@
#include "hci_h4p.h"
-inline void hci_h4p_outb(struct hci_h4p_info *info, unsigned int offset, u8 val)
-{
- __raw_writeb(val, info->uart_base + (offset << 2));
-}
-
-inline u8 hci_h4p_inb(struct hci_h4p_info *info, unsigned int offset)
-{
- return __raw_readb(info->uart_base + (offset << 2));
-}
-void hci_h4p_set_rts(struct hci_h4p_info *info, int active)
-{
- u8 b;
-
- b = hci_h4p_inb(info, UART_MCR);
- if (active)
- b |= UART_MCR_RTS;
- else
- b &= ~UART_MCR_RTS;
- hci_h4p_outb(info, UART_MCR, b);
-}
int hci_h4p_wait_for_cts(struct hci_h4p_info *info, int active,
int timeout_ms)
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2014-08-10 7:33 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-30 10:27 [PATCH] staging: nokia_h4: nokia_core.c: use usleep_range() instead of msleep() Miguel Oliveira
2014-05-30 11:34 ` Pavel Machek
2014-05-30 11:52 ` Marcel Holtmann
2014-05-30 12:30 ` Pavel Machek
2014-05-30 15:59 ` Greg KH
2014-05-30 16:15 ` Pali Rohár
2014-05-30 16:36 ` Greg KH
2014-08-06 20:56 ` Marcel Holtmann
2014-08-06 21:30 ` Pavel Machek
2014-08-07 0:25 ` Greg KH
2014-08-07 8:13 ` [PATCH] staging: nokia_h4: use more consistent name for intermediate object Pavel Machek
2014-08-07 20:24 ` Greg KH
2014-08-09 15:48 ` Pavel Machek
2014-08-10 7:29 ` [PATCH 1/3] staging: nokia_h4: switch to right types and use bdaddr_t Pavel Machek
2014-08-10 7:31 ` [PATCH 2/3] staging: nokia_h4: avoid __uX types Pavel Machek
2014-08-10 7:33 ` Pavel Machek [this message]
2014-08-10 7:34 ` [PATCH] bluetooth: avoid using " Pavel Machek
2014-08-07 9:07 ` [PATCH] staging: nokia_h4: merge firmware together so that we can reduce ammount of exports Pavel Machek
2014-08-07 9:36 ` Pavel Machek
2014-08-07 14:48 ` Marcel Holtmann
2014-08-09 15:47 ` Pavel Machek
2014-05-30 12:15 ` [PATCH] staging: nokia_h4: nokia_core.c: use usleep_range() instead of msleep() Miguel Oliveira
2014-05-30 12:35 ` Pavel Machek
2014-05-30 12:58 ` Miguel Oliveira
2014-05-30 16:01 ` Greg KH
2014-05-30 16:05 ` Miguel Oliveira
2014-05-30 16:13 ` Greg KH
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=20140810073343.GC19735@amd.pavel.ucw.cz \
--to=pavel@ucw.cz \
--cc=cmroliv@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=gulsah.1004@gmail.com \
--cc=kristina.martsenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=pali.rohar@gmail.com \
--cc=peter.p.waskiewicz.jr@intel.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®