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  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]
Date:	Sun, 22 Nov 2015 20:02:19 -0200
From:	Mauro Dreissig <mukadr@...il.com>
To:	Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com,
	gregkh@...uxfoundation.org
Cc:	netdev@...r.kernel.org, devel@...verdev.osuosl.org,
	mukadr@...il.com
Subject: [PATCH] staging: rtl8712: Cleanup _io_ops wrappers

This removes ugly and unnecessary declarations.

Signed-off-by: Mauro Dreissig <mukadr@...il.com>
---
 drivers/staging/rtl8712/rtl8712_io.c | 77 +++++++++++-------------------------
 1 file changed, 22 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_io.c b/drivers/staging/rtl8712/rtl8712_io.c
index 4148d48..391eff3 100644
--- a/drivers/staging/rtl8712/rtl8712_io.c
+++ b/drivers/staging/rtl8712/rtl8712_io.c
@@ -36,109 +36,76 @@
 
 u8 r8712_read8(struct _adapter *adapter, u32 addr)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
-	u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	_read8 = pintfhdl->io_ops._read8;
-	return  _read8(pintfhdl, addr);
+	return hdl->io_ops._read8(hdl, addr);
 }
 
 u16 r8712_read16(struct _adapter *adapter, u32 addr)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
-	u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	_read16 = pintfhdl->io_ops._read16;
-	return _read16(pintfhdl, addr);
+	return hdl->io_ops._read16(hdl, addr);
 }
 
 u32 r8712_read32(struct _adapter *adapter, u32 addr)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
-	u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	_read32 = pintfhdl->io_ops._read32;
-	return _read32(pintfhdl, addr);
+	return hdl->io_ops._read32(hdl, addr);
 }
 
 void r8712_write8(struct _adapter *adapter, u32 addr, u8 val)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
-	void (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	_write8 = pintfhdl->io_ops._write8;
-	_write8(pintfhdl, addr, val);
+	hdl->io_ops._write8(hdl, addr, val);
 }
 
 void r8712_write16(struct _adapter *adapter, u32 addr, u16 val)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
-	void (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	_write16 = pintfhdl->io_ops._write16;
-	_write16(pintfhdl, addr, val);
+	hdl->io_ops._write16(hdl, addr, val);
 }
 
 void r8712_write32(struct _adapter *adapter, u32 addr, u32 val)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl  = &(pio_queue->intf);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	void (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
-
-	_write32 = pintfhdl->io_ops._write32;
-	_write32(pintfhdl, addr, val);
+	hdl->io_ops._write32(hdl, addr, val);
 }
 
 void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
-			  u8 *pmem);
 	if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
 		return;
-	_read_mem = pintfhdl->io_ops._read_mem;
-	_read_mem(pintfhdl, addr, cnt, pmem);
+
+	hdl->io_ops._read_mem(hdl, addr, cnt, pmem);
 }
 
 void r8712_write_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
-	void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
-			   u8 *pmem);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	_write_mem = pintfhdl->io_ops._write_mem;
-	_write_mem(pintfhdl, addr, cnt, pmem);
+	hdl->io_ops._write_mem(hdl, addr, cnt, pmem);
 }
 
 void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl	*pintfhdl = &(pio_queue->intf);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
-			  u8 *pmem);
 	if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
 		return;
-	_read_port = pintfhdl->io_ops._read_port;
-	_read_port(pintfhdl, addr, cnt, pmem);
+
+	hdl->io_ops._read_port(hdl, addr, cnt, pmem);
 }
 
 void r8712_write_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
 {
-	struct io_queue *pio_queue = adapter->pio_queue;
-	struct intf_hdl *pintfhdl = &(pio_queue->intf);
+	struct intf_hdl *hdl = &adapter->pio_queue->intf;
 
-	u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
-			   u8 *pmem);
-	_write_port = pintfhdl->io_ops._write_port;
-	_write_port(pintfhdl, addr, cnt, pmem);
+	hdl->io_ops._write_port(hdl, addr, cnt, pmem);
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists