2012-02-16 07:03:10

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [RFC] ath9k: remove rx_bufptr

From: Mohammed Shafi Shajakhan <[email protected]>

it does not seems to used for anything

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 1 -
drivers/net/wireless/ath/ath9k/recv.c | 4 ----
2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 171ccf7..603f686 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -311,7 +311,6 @@ struct ath_rx {
spinlock_t rxbuflock;
struct list_head rxbuf;
struct ath_descdma rxdma;
- struct ath_buf *rx_bufptr;
struct ath_rx_edma rx_edma[ATH9K_RX_QUEUE_MAX];

struct sk_buff *frag;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 7e1a91a..c9612d9 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -224,9 +224,6 @@ static void ath_rx_edma_cleanup(struct ath_softc *sc)
}

INIT_LIST_HEAD(&sc->rx.rxbuf);
-
- kfree(sc->rx.rx_bufptr);
- sc->rx.rx_bufptr = NULL;
}

static void ath_rx_edma_init_queue(struct ath_rx_edma *rx_edma, int size)
@@ -259,7 +256,6 @@ static int ath_rx_edma_init(struct ath_softc *sc, int nbufs)
return -ENOMEM;

INIT_LIST_HEAD(&sc->rx.rxbuf);
- sc->rx.rx_bufptr = bf;

for (i = 0; i < nbufs; i++, bf++) {
skb = ath_rxbuf_alloc(common, common->rx_bufsize, GFP_KERNEL);
--
1.7.0.4



2012-02-16 08:16:22

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: Re: [RFC] ath9k: remove rx_bufptr

Hi Felix,

On Thursday 16 February 2012 01:08 PM, Felix Fietkau wrote:
> On 2012-02-16 8:03 AM, Mohammed Shafi Shajakhan wrote:
>> From: Mohammed Shafi Shajakhan<[email protected]>
>>
>> it does not seems to used for anything
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
>> ---
>> drivers/net/wireless/ath/ath9k/ath9k.h | 1 -
>> drivers/net/wireless/ath/ath9k/recv.c | 4 ----
>> 2 files changed, 0 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h
>> b/drivers/net/wireless/ath/ath9k/ath9k.h
>> index 171ccf7..603f686 100644
>> --- a/drivers/net/wireless/ath/ath9k/ath9k.h
>> +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
>> @@ -311,7 +311,6 @@ struct ath_rx {
>> spinlock_t rxbuflock;
>> struct list_head rxbuf;
>> struct ath_descdma rxdma;
>> - struct ath_buf *rx_bufptr;
>> struct ath_rx_edma rx_edma[ATH9K_RX_QUEUE_MAX];
>>
>> struct sk_buff *frag;
>> diff --git a/drivers/net/wireless/ath/ath9k/recv.c
>> b/drivers/net/wireless/ath/ath9k/recv.c
>> index 7e1a91a..c9612d9 100644
>> --- a/drivers/net/wireless/ath/ath9k/recv.c
>> +++ b/drivers/net/wireless/ath/ath9k/recv.c
>> @@ -224,9 +224,6 @@ static void ath_rx_edma_cleanup(struct ath_softc *sc)
>> }
>>
>> INIT_LIST_HEAD(&sc->rx.rxbuf);
>> -
>> - kfree(sc->rx.rx_bufptr);
>> - sc->rx.rx_bufptr = NULL;
>> }
>>
> Take a look at this part. It's used for avoiding a memleak, so please
> keep it ;)

sure i will leave it as it is, thanks for the review :)

--
thanks,
shafi

2012-02-16 07:38:38

by Felix Fietkau

[permalink] [raw]
Subject: Re: [RFC] ath9k: remove rx_bufptr

On 2012-02-16 8:03 AM, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan<[email protected]>
>
> it does not seems to used for anything
>
> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/ath9k.h | 1 -
> drivers/net/wireless/ath/ath9k/recv.c | 4 ----
> 2 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
> index 171ccf7..603f686 100644
> --- a/drivers/net/wireless/ath/ath9k/ath9k.h
> +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
> @@ -311,7 +311,6 @@ struct ath_rx {
> spinlock_t rxbuflock;
> struct list_head rxbuf;
> struct ath_descdma rxdma;
> - struct ath_buf *rx_bufptr;
> struct ath_rx_edma rx_edma[ATH9K_RX_QUEUE_MAX];
>
> struct sk_buff *frag;
> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
> index 7e1a91a..c9612d9 100644
> --- a/drivers/net/wireless/ath/ath9k/recv.c
> +++ b/drivers/net/wireless/ath/ath9k/recv.c
> @@ -224,9 +224,6 @@ static void ath_rx_edma_cleanup(struct ath_softc *sc)
> }
>
> INIT_LIST_HEAD(&sc->rx.rxbuf);
> -
> - kfree(sc->rx.rx_bufptr);
> - sc->rx.rx_bufptr = NULL;
> }
>
Take a look at this part. It's used for avoiding a memleak, so please
keep it ;)