Thu, Feb 02, 2017 at 11:34:48PM CET, da...@davemloft.net wrote: >From: Jiri Pirko <j...@resnulli.us> >Date: Thu, 2 Feb 2017 16:12:57 +0100 > >> +static int mlxsw_sp_acl_tcam_region_id_get(struct mlxsw_sp_acl_tcam *tcam, >> + u16 *p_id) >> +{ >> + u16 id; >> + >> + id = find_first_zero_bit(tcam->used_regions, tcam->max_regions); >> + if (id < tcam->max_regions) { >> + set_bit(id, tcam->used_regions); > ... >> +static void mlxsw_sp_acl_tcam_region_id_put(struct mlxsw_sp_acl_tcam *tcam, >> + u16 id) >> +{ >> + clear_bit(id, tcam->used_regions); >> +} >> + >> +static int mlxsw_sp_acl_tcam_group_id_get(struct mlxsw_sp_acl_tcam *tcam, >> + u16 *p_id) >> +{ >> + u16 id; >> + >> + id = find_first_zero_bit(tcam->used_groups, tcam->max_groups); >> + if (id < tcam->max_groups) { >> + set_bit(id, tcam->used_groups); > ... >> +static void mlxsw_sp_acl_tcam_group_id_put(struct mlxsw_sp_acl_tcam *tcam, >> + u16 id) >> +{ >> + clear_bit(id, tcam->used_groups); >> +} > >Please use __set_bit() and __clear_bit() here since it seems very clear that >you do not require atomic operations.
Will do.