Search Linux Wireless

Re: [PATCH 2/2] mac80211: let unused MPP table entries timeout

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

 



On Tue, Jan 19, 2016 at 09:04:32AM +0100, Henning Rogge wrote:
>  	err = -ENXIO;
> -enddel:
> +enddelpath:

Concur about it being better to leave this label alone, also the diff looks
weird because it continues:

> +	mesh_paths_generation++;
> +	spin_unlock(&tbl->hashwlock[hash_idx]);
> +	read_unlock_bh(&pathtbl_resize_lock);
> +	return err;
> +}

[...]

> +	err = -ENXIO;
> +enddelmpp:
>  	mesh_paths_generation++;
>  	spin_unlock(&tbl->hashwlock[hash_idx]);
>  	read_unlock_bh(&pathtbl_resize_lock);

At first I wondered why the last half of the function was changed, but then
I saw that.  Shouldn't the above be "mpp_paths_generation++;"?

In general I'd like to merge these two into one function; the only thing
different is the initial table pointer that gets dereferenced and the
generation counter (and now the labels).  So something like this should
be doable:

static int mesh_table_delete(struct ieee80211_sub_if_data *sdata,
                             struct mesh_table *tbl,
                             const u8 *addr)
{
        /* basically what mesh_path_del is today */
}

int mesh_path_del(...)
{
        tbl = resize_dereference_mesh_paths();
        ret = mesh_table_delete(sdata, tbl, addr);
        mesh_paths_generation++;
        return ret;
}

int mpp_path_del(...)
{
        tbl = resize_dereference_mpp_paths();
        ret = mesh_table_delete(sdata, tbl, addr);
        mpp_paths_generation++;
        return ret;
}

-- 
Bob Copeland %% http://bobcopeland.com/
--
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