lkml.org 
[lkml]   [2016]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 9/9] staging: ks7010: Delete three unnecessary variable initialisations
    On Sun, Jul 17, 2016 at 08:51:39PM +0200, Julia Lawall wrote:
    >
    >
    > On Sun, 17 Jul 2016, SF Markus Elfring wrote:
    >
    > > From: Markus Elfring <elfring@users.sourceforge.net>
    > > Date: Sun, 17 Jul 2016 19:40:47 +0200
    > >
    > > Three variables will be set to an appropriate value a bit later.
    > > Thus omit the explicit initialisation at the beginning.
    > >
    > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    > > ---
    > > drivers/staging/ks7010/ks7010_sdio.c | 8 ++++----
    > > 1 file changed, 4 insertions(+), 4 deletions(-)
    > >
    > > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
    > > index e06bc3c..3c62c57 100644
    > > --- a/drivers/staging/ks7010/ks7010_sdio.c
    > > +++ b/drivers/staging/ks7010/ks7010_sdio.c
    > > @@ -323,14 +323,14 @@ static void tx_device_task(void *dev)
    > > {
    > > struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
    > > struct tx_device_buffer *sp;
    > > - int rc = 0;
    > >
    > > DPRINTK(4, "\n");
    > > if (cnt_txqbody(priv) > 0
    > > && atomic_read(&priv->psstatus.status) != PS_SNOOZE) {
    > > sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
    > > if (priv->dev_state >= DEVICE_STATE_BOOT) {
    > > - rc = write_to_device(priv, sp->sendp, sp->size);
    > > + int rc = write_to_device(priv, sp->sendp, sp->size);
    >
    > This does not look appealing to me, neither the declaration in the middle
    > of the function, nor the intiialization to the result of a complex
    > expression, nor the separation of the call and the error checking code by
    > a blank line. There is nothing wrong with having the rc variable be
    > declared at the the top of the function, in its normal place.

    +1

    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2016-07-20 18:41    [W:4.048 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site