Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E64EAC4332F for ; Tue, 28 Dec 2021 22:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237513AbhL1WUA (ORCPT ); Tue, 28 Dec 2021 17:20:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234078AbhL1WT7 (ORCPT ); Tue, 28 Dec 2021 17:19:59 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76D89C06173E for ; Tue, 28 Dec 2021 14:19:59 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id x15so14520109plg.1 for ; Tue, 28 Dec 2021 14:19:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Lf/S2LPQ9iI7bcBTT4neE6R0mg+6glQTGFFuCfpCfPU=; b=H27QTjm7//8xn5TkIeh4DbZhOQBBWPJMp9HmbhnsxgcUzz+QDTgPo5g1YVW2POQEXt 7JH1x52wN7F2GPOv0WZxGqsKvO3KhlsZDC8nTS9UwNez14WdJ/VBnMSHf4KRvpqTBY2Z LsGJV+yTGEjBRGlfzNYKE9QE8PGX4SrP5IISidTwx35seExtzdFznI8Rw+NdQTuJJzdP bmX5FqpJhUqYiruuLiDFV1DVhWAhhnkf1fQKq1r1z52pq7G0iFNhzQIRQbT1cX8AErAr I2B8Kvmwk8nA4HNd5zSI77YHvMNse1hmJ5C8XEfu3GZ6onwwsD6/grrGKDZNCEIGCPxe Pfig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Lf/S2LPQ9iI7bcBTT4neE6R0mg+6glQTGFFuCfpCfPU=; b=FkXntaGC1/2vr82rVg9AH6ThUaDtCp25Dd/X5alMQgIr1dvOBcwloIlZ/p+EFOk+MD sBzCuMJZ1vfvu6rzxxkTxVnX+D+3mF2vbatEqZauvE1wF6kmIq+1woo9tHLhRzBt3thb /JXj/nT7bRsKLN4NB3KRmD1oPsSwSoOKH/WGZg1uJG0kLmHditpa+0fUzdwi2hlJkJrt 4sb6IhH48pY9rMvqw6ooQFsTsYwGH0QOQEyr9lEqzgoOzgUJG2Km47AgX7Vi9Xr3IOl4 PCJhQBJgEKzviwedBgFGHBf9Xq7tUXy+OUHno0jU4p1fqZw4WQ/an3EXYK5itba1aU4U lrhA== X-Gm-Message-State: AOAM530CibndJ026Fw6JW4bMcRmj4e5ctyK6V8W+5P8GWyNEDQ9CZv0r 6kHDcinCShr//HG8Cfvn7BlZEA== X-Google-Smtp-Source: ABdhPJxbJ0Ghxhf4j2KXJuAZGS3rqzQ0STdUeiLcJPn08C8tH2xoq1KqTCRw10/cERp7eAdhkUvK+w== X-Received: by 2002:a17:90b:4b0e:: with SMTP id lx14mr28606702pjb.132.1640729998902; Tue, 28 Dec 2021 14:19:58 -0800 (PST) Received: from [192.168.0.2] ([50.53.47.17]) by smtp.gmail.com with ESMTPSA id u33sm23597804pfg.4.2021.12.28.14.19.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Dec 2021 14:19:58 -0800 (PST) Message-ID: Date: Tue, 28 Dec 2021 14:21:32 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH] ionic: Initialize the 'lif->dbid_inuse' bitmap Content-Language: en-US To: Christophe JAILLET , drivers@pensando.io, davem@davemloft.net, kuba@kernel.org, allenbh@pensando.io Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <6a478eae0b5e6c63774e1f0ddb1a3f8c38fa8ade.1640527506.git.christophe.jaillet@wanadoo.fr> From: Shannon Nelson In-Reply-To: <6a478eae0b5e6c63774e1f0ddb1a3f8c38fa8ade.1640527506.git.christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/26/21 6:06 AM, Christophe JAILLET wrote: > When allocated, this bitmap is not initialized. Only the first bit is set a > few lines below. > > Use bitmap_zalloc() to make sure that it is cleared before being used. > > Fixes: 6461b446f2a0 ("ionic: Add interrupts and doorbells") > Signed-off-by: Christophe JAILLET Signed-off-by: Shannon Nelson > --- > The 'dbid_inuse' bitmap seems to be unused. > So it is certainly better to remove it completely instead of "fixing" it. > > Let me know if it is the way to go or if it is there for future use. > > If it should be left in place, the corresponding kfree() should also be > replaces by some bitmap_free() to keep consistency. This looks like one of those small bits that creeps in from the out-of-tree incarnation, is expected to used Real Soon Now, but is not really useful yet.  Yes, this probably should come out until actually useful.  When we get back from the holiday vacations we'll take a closer look at it and make sure we're not causing any unforeseen issues by pulling it out for now. Thanks, sln > --- > drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c > index 63f8a8163b5f..2ff7be17e5af 100644 > --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c > +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c > @@ -3135,7 +3135,7 @@ int ionic_lif_init(struct ionic_lif *lif) > return -EINVAL; > } > > - lif->dbid_inuse = bitmap_alloc(lif->dbid_count, GFP_KERNEL); > + lif->dbid_inuse = bitmap_zalloc(lif->dbid_count, GFP_KERNEL); > if (!lif->dbid_inuse) { > dev_err(dev, "Failed alloc doorbell id bitmap, aborting\n"); > return -ENOMEM;