Search Linux Wireless

Re: [RFC 03/20] mac80211: add drv_* wrappers for channel contexts

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

 



On Fri, 2012-07-27 at 13:16 +0200, Johannes Berg wrote:
> From: Michal Kazior <michal.kazior@xxxxxxxxx>
[]
> diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
[]
> @@ -866,4 +866,50 @@ static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
[]
> +static inline void drv_add_chanctx(struct ieee80211_local *local,
> +				   struct ieee80211_chanctx *ctx)
> +{
> +	if (local->ops->add_chanctx)
> +		local->ops->add_chanctx(&local->hw, &ctx->conf);

Perhaps these repeated function names should be some macro
to avoid typos or copy/paste errors.

Maybe something like:

#define local_op(func, ...)				\
do {							\
	if (local->ops->func)				\
		local->ops->func(##__VA_ARGS__);	\
} while (0)

So the uses become:

	local_op(add_chanctx, &local->hw, &ctx->conf);

> +static inline void drv_remove_chanctx(struct ieee80211_local *local,
> +				      struct ieee80211_chanctx *ctx)
> +{
> +	if (local->ops->remove_chanctx)
> +		local->ops->remove_chanctx(&local->hw, &ctx->conf);

	local_op(remove_chanctx, &local->hw, &ctx->conf);

etc...


--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux