Search Linux Wireless

Re: [PATCH v3 42/97] ath9k: Make bf_desc of ath_buf opaque

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

 



On 2010-04-17 12:00 AM, Pavel Roskin wrote:
> On Thu, 2010-04-15 at 17:38 -0400, Luis R. Rodriguez wrote:
>> From: Vasanthakumar Thiagarajan <vasanth@xxxxxxxxxxx>
>> 
>> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@xxxxxxxxxxx>
> 
>> -	struct ath_desc *bf_desc;	/* virtual addr of desc */
>> +	void *bf_desc;			/* virtual addr of desc */
> 
> Why?
> 
> The obvious downside is that bf_desc becomes compatible with pointers of
> any type.
Because on AR9300 where it's used, it points to a struct ar9003_txc instead.

> The only upside I can think of is that bf_desc won't be dereferenced by
> accident.  The same could be done by using a scalar type or
> __attribute__((noderef)).
I don't think a scalar type makes any sense for this, because it is a
pointer, and it does get passed to functions that dereference it.
In cases where struct ar9003_txc is used, it'd have to pass through
either an explicit cast or an implicit one going through void* anyway,
so we might as well make it clear that while bf_desc is a valid pointer,
it does not always point to struct ath_desc

- Felix
--
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