lkml.org 
[lkml]   [2022]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/5] octeontx2-af: Fix a potentially spurious error message
    Date
    When this error message is displayed, we know that the all the bits in the
    bitmap are set.

    So, bitmap_weight() will return the number of bits of the bitmap, which is
    'table->tot_ids'.

    It is unlikely that a bit will be cleared between mutex_unlock() and
    dev_err(), but, in order to simplify the code and avoid this possibility,
    just take 'table->tot_ids'.

    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    ---
    drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
    index 594029007f85..5e6c54577a97 100644
    --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
    +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
    @@ -490,7 +490,7 @@ static bool rvu_npc_exact_alloc_id(struct rvu *rvu, u32 *seq_id)
    if (idx == table->tot_ids) {
    mutex_unlock(&table->lock);
    dev_err(rvu->dev, "%s: No space in id bitmap (%d)\n",
    - __func__, bitmap_weight(table->id_bmap, table->tot_ids));
    + __func__, table->tot_ids);

    return false;
    }
    --
    2.34.1
    \
     
     \ /
      Last update: 2022-11-25 13:24    [W:5.013 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site