From: Dan Carpenter <dan.carpenter@oracle.com>
To: Axel Rasmussen <axel.rasmussen1@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 9/9] drivers: staging: rtl8187se: refactor wmm_param_update
Date: Mon, 3 Mar 2014 12:15:15 +0300 [thread overview]
Message-ID: <20140303091515.GK26722@mwanda> (raw)
In-Reply-To: <1393737773-13937-10-git-send-email-axel.rasmussen1@gmail.com>
On Sat, Mar 01, 2014 at 10:22:53PM -0700, Axel Rasmussen wrote:
> The function rtl8180_wmm_param_update contained two blocks of code which
> were nearly identical. This patch combines those two blocks into a
> single function, to reduce code duplication, and do fix some
> checkpatch.pl warnings about excessively long lines due to the large
> number of indents that were needed for the original blocks of code.
>
> Signed-off-by: Axel Rasmussen <axel.rasmussen1@gmail.com>
> ---
> drivers/staging/rtl8187se/r8180_core.c | 119 ++++++++++++++-------------------
> 1 file changed, 49 insertions(+), 70 deletions(-)
>
> diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
> index b6fdb6f..fc5d4d9 100644
> --- a/drivers/staging/rtl8187se/r8180_core.c
> +++ b/drivers/staging/rtl8187se/r8180_core.c
> @@ -2114,16 +2114,49 @@ static void rtl8180_hw_sleep(struct net_device *dev, u32 th, u32 tl)
> spin_unlock_irqrestore(&priv->ps_lock, flags);
> }
>
> +static void rtl8180_wmm_single_param_update(struct net_device *dev,
> + u8 mode, AC_CODING eACI, PAC_PARAM param)
> +{
> + u8 u1bAIFS;
> + u32 u4bAcParam;
> +
> + /* Retrieve parameters to update. */
> + /* Mode G/A: slotTimeTimer = 9; Mode B: 20 */
> + u1bAIFS = param->f.AciAifsn.f.AIFSN * ((mode & IEEE_G) == IEEE_G ?
> + 9 : 20) + aSifsTime;
> + u4bAcParam = (((u32)param->f.TXOPLimit << AC_PARAM_TXOP_LIMIT_OFFSET) |
> + ((u32)param->f.Ecw.f.ECWmax << AC_PARAM_ECW_MAX_OFFSET) |
> + ((u32)param->f.Ecw.f.ECWmin << AC_PARAM_ECW_MIN_OFFSET) |
> + ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET));
> +
> + switch (eACI) {
> + case AC1_BK:
> + write_nic_dword(dev, AC_BK_PARAM, u4bAcParam);
> + break;
> + case AC0_BE:
> + write_nic_dword(dev, AC_BE_PARAM, u4bAcParam);
> + break;
> + case AC2_VI:
> + write_nic_dword(dev, AC_VI_PARAM, u4bAcParam);
> + break;
> + case AC3_VO:
> + write_nic_dword(dev, AC_VO_PARAM, u4bAcParam);
> + break;
> + default:
> + pr_warn("SetHwReg8185(): invalid ACI: %d!\n", eACI);
> + break;
Missing tab here. Anyway, just swap all the break statements for
returns.
regards,
dan carpenter
> + }
> +}
> +
next prev parent reply other threads:[~2014-03-03 9:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-02 5:22 [PATCH 0/9] drivers: staging: rtl8187se: various code cleanups Axel Rasmussen
2014-03-02 5:22 ` [PATCH 1/9] drivers: staging: rtl8187se: use netdev_* instead of prink Axel Rasmussen
2014-03-02 5:22 ` [PATCH 2/9] drivers: staging: rtl8187se: refactor/clean signal smoothing Axel Rasmussen
2014-03-02 5:22 ` [PATCH 3/9] drivers: staging: rtl8187se: wrap excessively long lines Axel Rasmussen
2014-03-03 8:58 ` Dan Carpenter
2014-03-02 5:22 ` [PATCH 4/9] " Axel Rasmussen
2014-03-03 9:02 ` Dan Carpenter
2014-03-02 5:22 ` [PATCH 5/9] " Axel Rasmussen
2014-03-02 5:22 ` [PATCH 6/9] drivers: staging: rtl8187se: fixed broken indentation Axel Rasmussen
2014-03-02 5:22 ` [PATCH 7/9] drivers: staging: rtl8187se: fixed checkpatch.pl errors Axel Rasmussen
2014-03-02 5:36 ` Joe Perches
2014-03-02 20:19 ` axel.rasmussen1
2014-03-02 5:22 ` [PATCH 8/9] drivers: staging: rtl8187se: wrap excessively long lines Axel Rasmussen
2014-03-02 5:22 ` [PATCH 9/9] drivers: staging: rtl8187se: refactor wmm_param_update Axel Rasmussen
2014-03-03 9:15 ` Dan Carpenter [this message]
2014-03-04 7:12 ` [PATCH v2 0/9] drivers: staging: rtl8187se: various code cleanups Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 1/9] drivers: staging: rtl8187se: use netdev_* instead of prink Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 2/9] drivers: staging: rtl8187se: refactor/clean signal smoothing Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 3/9] drivers: staging: rtl8187se: wrap excessively long lines Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 4/9] " Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 5/9] " Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 6/9] drivers: staging: rtl8187se: fixed broken indentation Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 7/9] drivers: staging: rtl8187se: fixed checkpatch.pl errors Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 8/9] drivers: staging: rtl8187se: wrap excessively long lines Axel Rasmussen
2014-03-04 7:12 ` [PATCH v2 9/9] drivers: staging: rtl8187se: refactor wmm_param_update Axel Rasmussen
2014-03-04 9:51 ` [PATCH v2 0/9] drivers: staging: rtl8187se: various code cleanups Dan Carpenter
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=20140303091515.GK26722@mwanda \
--to=dan.carpenter@oracle.com \
--cc=axel.rasmussen1@gmail.com \
--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 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.