Search Linux Wireless

Re: [PATCH v2] mwifiex: remove linked list implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2011-01-12 at 21:16 -0800, Bing Zhao wrote:

Better,

> +	list_del((struct list_head *) tx_ba_tsr_tbl);

but you shouldn't be casting at all. Do list_del(&tx_ba_tsr_tbl->list);
or so instead, so that this works when the list_head isn't the first
item in the struct.
 
> -	mwifiex_util_init_list((struct mwifiex_linked_list *) &priv->
> -			       tx_ba_stream_tbl_ptr);
> +	INIT_LIST_HEAD((struct list_head *) &priv->tx_ba_stream_tbl_ptr);

Same here. Try to get rid of all casts. If you have any specific ones
that you don't know how to get rid of, feel free to ask.

> -	while (ra_list != (struct mwifiex_ra_list_tbl *) ra_list_hhead) {
> -		if (mwifiex_util_peek_list(&ra_list->buf_head, true))
> +	int is_list_empty;
> +	unsigned long flags;
> +
> +	list_for_each_entry(ra_list, ra_list_hhead, list) {
> +		spin_lock_irqsave(&ra_list->ra_list_tbl_lock, flags);
> +		is_list_empty = list_empty(&ra_list->buf_head);
> +		spin_unlock_irqrestore(&ra_list->ra_list_tbl_lock, flags);
> +		if (!is_list_empty)
>  			return false;
> -
> -		ra_list = (struct mwifiex_ra_list_tbl *) ra_list->next;
>  	}

This seems rather dubious. If the list is empty, the for_each_entry
won't do anything? Or is that some other list?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux