lkml.org 
[lkml]   [2021]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 16/33] staging: wfx: declare variables at beginning of functions
    Date
    From: Jérôme Pouiller <jerome.pouiller@silabs.com>

    For better code, we prefer to declare all the local variables at
    beginning of the functions.

    Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
    ---
    drivers/staging/wfx/data_tx.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
    index caeaf836147f..00c305f192bb 100644
    --- a/drivers/staging/wfx/data_tx.c
    +++ b/drivers/staging/wfx/data_tx.c
    @@ -108,6 +108,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
    int idx;
    struct tx_policy_cache *cache = &wvif->tx_policy_cache;
    struct tx_policy wanted;
    + struct tx_policy *entry;

    wfx_tx_policy_build(wvif, &wanted, rates);

    @@ -121,11 +122,10 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
    if (idx >= 0) {
    *renew = false;
    } else {
    - struct tx_policy *entry;
    - *renew = true;
    - /* If policy is not found create a new one
    - * using the oldest entry in "free" list
    + /* If policy is not found create a new one using the oldest
    + * entry in "free" list
    */
    + *renew = true;
    entry = list_entry(cache->free.prev, struct tx_policy, link);
    memcpy(entry->rates, wanted.rates, sizeof(entry->rates));
    entry->uploaded = false;
    --
    2.33.0
    \
     
     \ /
      Last update: 2021-09-13 10:36    [W:3.157 / U:0.508 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site