mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: navin patidar <navin.patidar@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org,
	navin patidar <navin.patidar@gmail.com>
Subject: [PATCH 37/42] staging: rtl8188eu: Use round_up() instead of _RND4()
Date: Sun, 22 Jun 2014 14:21:41 +0530	[thread overview]
Message-ID: <1403427107-12744-9-git-send-email-navin.patidar@gmail.com> (raw)
In-Reply-To: <1403427107-12744-1-git-send-email-navin.patidar@gmail.com>

Signed-off-by: navin patidar <navin.patidar@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c          |    2 +-
 drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c    |    4 ++--
 drivers/staging/rtl8188eu/include/osdep_service.h |    8 --------
 drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c  |    2 +-
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index a292c5d..343a6ca 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -324,7 +324,7 @@ _next:
 
 		pcmdpriv->cmd_issued_cnt++;
 
-		pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */
+		pcmd->cmdsz = round_up(pcmd->cmdsz, 4);
 
 		memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
 
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
index 8543847..902bbe0 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
@@ -544,7 +544,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
 
 		len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE + (pxmitframe->pkt_offset*PACKET_OFFSET_SZ);
 
-		if (_RND8(pbuf + len) > MAX_XMITBUF_SZ) {
+		if (round_up(pbuf + len, 8) > MAX_XMITBUF_SZ) {
 			pxmitframe->agg_num = 1;
 			pxmitframe->pkt_offset = 1;
 			break;
@@ -567,7 +567,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
 
 		/*  handle pointer and stop condition */
 		pbuf_tail = pbuf + len;
-		pbuf = _RND8(pbuf_tail);
+		pbuf = round_up(pbuf_tail, 8);
 
 		pfirstframe->agg_num++;
 		if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num)
diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h
index 927b30b..913cbfe 100644
--- a/drivers/staging/rtl8188eu/include/osdep_service.h
+++ b/drivers/staging/rtl8188eu/include/osdep_service.h
@@ -181,14 +181,6 @@ static inline void flush_signals_thread(void)
 #define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r))
 #define RND4(x)	(((x >> 2) + (((x & 3) == 0) ?  0 : 1)) << 2)
 
-static inline u32 _RND4(u32 sz)
-{
-	u32	val;
-
-	val = ((sz >> 2) + ((sz & 3) ? 1 : 0)) << 2;
-	return val;
-}
-
 struct rtw_netdev_priv_indicator {
 	void *priv;
 	u32 sizeof_priv;
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index eddff41..ba1e178 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -163,7 +163,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
 			pkt_offset = (u16) round_up(pkt_offset, 128);
 			break;
 		case USB_RX_AGG_USB:
-			pkt_offset = (u16)_RND4(pkt_offset);
+			pkt_offset = (u16) round_up(pkt_offset, 4);
 			break;
 		case USB_RX_AGG_DISABLE:
 		default:
-- 
1.7.10.4


  parent reply	other threads:[~2014-06-22  8:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-22  8:51 [PATCH 29/42] staging: rtl8188eu: Use get_unaligned_be16() instead of RTW_GET_BE16() navin patidar
2014-06-22  8:51 ` [PATCH 30/42] staging: rtl8188eu: Remove unused inline function bitshift() navin patidar
2014-06-22  8:51 ` [PATCH 31/42] staging: rtl8188eu: Use get_unaligned_le16() instead of RTW_GET_LE16() navin patidar
2014-06-22  8:51 ` [PATCH 32/42] staging: rtl8188eu: Use cpu_to_le16() insted of RTW_PUT_LE16() navin patidar
2014-06-22  8:51 ` [PATCH 33/42] staging: rtl8188eu: osdep_service.h: Remove unused function definations navin patidar
2014-06-22  8:51 ` [PATCH 34/42] staging: rtl8188eu: Remove unused inline function _RND256() navin patidar
2014-06-22  8:51 ` [PATCH 35/42] staging: rtl8188eu: Use round_up() instead of _RND128() navin patidar
2014-06-22  8:51 ` [PATCH 36/42] staging: rtl8188eu: Use round_up() instead of _RND8() navin patidar
2014-06-22  8:51 ` navin patidar [this message]
2014-06-22  8:51 ` [PATCH 38/42] staging: rtl8188eu: osdep_service.h: Remove unused macros navin patidar
2014-06-22  8:51 ` [PATCH 39/42] staging: rtl8188eu: Use round_up() instead of RND4() navin patidar
2014-06-22  8:51 ` [PATCH 40/42] staging: rtl8188eu: Remove function thread_enter() navin patidar
2014-06-22  8:51 ` [PATCH 41/42] staging: rtl8188eu: Remove function flush_signals_thread() navin patidar
2014-06-22  8:51 ` [PATCH 42/42] staging: rtl8188eu: Replace _cancel_timer() with del_timer_sync() navin patidar

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=1403427107-12744-9-git-send-email-navin.patidar@gmail.com \
    --to=navin.patidar@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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 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®