[PATCH 1/7] drivers/net/wireless/b43/lo.c: remove unused variable - Kernel

This is a discussion on [PATCH 1/7] drivers/net/wireless/b43/lo.c: remove unused variable - Kernel ; From: Julia Lawall The variable trsw_rx is initialized but never used otherwise. The semantic patch that makes this change is as follows: ( http://www.emn.fr/x-info/coccinelle/ ) // @@ type T; identifier i; constant C; @@ ( extern T i; | - ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH 1/7] drivers/net/wireless/b43/lo.c: remove unused variable

  1. [PATCH 1/7] drivers/net/wireless/b43/lo.c: remove unused variable

    From: Julia Lawall

    The variable trsw_rx is initialized but never used otherwise.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    type T;
    identifier i;
    constant C;
    @@

    (
    extern T i;
    |
    - T i;
    <+... when != i
    - i = C;
    ...+>
    )
    //


    Signed-off-by: Julia Lawall
    ---
    drivers/net/wireless/b43/lo.c | 5 +----
    1 file changed, 1 insertion(+), 4 deletions(-)

    diff -u -p a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c
    --- a/drivers/net/wireless/b43/lo.c 2008-03-12 14:13:14.000000000 +0100
    +++ b/drivers/net/wireless/b43/lo.c 2008-03-15 15:56:58.000000000 +0100
    @@ -493,15 +493,12 @@ static void lo_measure_gain_values(struc
    max_rx_gain = 0;

    if (has_loopback_gain(phy)) {
    - int trsw_rx = 0;
    int trsw_rx_gain;

    if (use_trsw_rx) {
    trsw_rx_gain = phy->trsw_rx_gain / 2;
    - if (max_rx_gain >= trsw_rx_gain) {
    + if (max_rx_gain >= trsw_rx_gain)
    trsw_rx_gain = max_rx_gain - trsw_rx_gain;
    - trsw_rx = 0x20;
    - }
    } else
    trsw_rx_gain = max_rx_gain;
    if (trsw_rx_gain < 9) {
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH 1/7] drivers/net/wireless/b43/lo.c: remove unused variable

    On Saturday 15 March 2008 17:02:36 Julia Lawall wrote:
    > From: Julia Lawall
    >
    > The variable trsw_rx is initialized but never used otherwise.


    You get a NACK for now. Most likely this is a bug and the variable
    does actually have to be used somewhere. I'll take a look at it.

    > Signed-off-by: Julia Lawall
    > ---
    > drivers/net/wireless/b43/lo.c | 5 +----
    > 1 file changed, 1 insertion(+), 4 deletions(-)
    >
    > diff -u -p a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c
    > --- a/drivers/net/wireless/b43/lo.c 2008-03-12 14:13:14.000000000 +0100
    > +++ b/drivers/net/wireless/b43/lo.c 2008-03-15 15:56:58.000000000 +0100
    > @@ -493,15 +493,12 @@ static void lo_measure_gain_values(struc
    > max_rx_gain = 0;
    >
    > if (has_loopback_gain(phy)) {
    > - int trsw_rx = 0;
    > int trsw_rx_gain;
    >
    > if (use_trsw_rx) {
    > trsw_rx_gain = phy->trsw_rx_gain / 2;
    > - if (max_rx_gain >= trsw_rx_gain) {
    > + if (max_rx_gain >= trsw_rx_gain)
    > trsw_rx_gain = max_rx_gain - trsw_rx_gain;
    > - trsw_rx = 0x20;
    > - }
    > } else
    > trsw_rx_gain = max_rx_gain;
    > if (trsw_rx_gain < 9) {



    --
    Greetings Michael.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread