Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1124720imw; Tue, 5 Jul 2022 04:18:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vQVFx+xAA9L3F3t8nQIg3T+w9lWc7AMxP5AL+ztsq/iA0lD1eZTXHcOETFdeVywYzCDpjZ X-Received: by 2002:aa7:82ca:0:b0:51b:cf43:d00a with SMTP id f10-20020aa782ca000000b0051bcf43d00amr41186037pfn.58.1657019913376; Tue, 05 Jul 2022 04:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657019913; cv=none; d=google.com; s=arc-20160816; b=Gjjzc9cfBUfDFMTFdsMc1ken6SVMf6Y1SnLw4teXbghMmrNWRKke3ffaFYNxntuCHj fH3NJvqAET+7wTy7Vw6k69L4hZ6yILMTE6RwyPqazzBuTqP/GvSanvsXp4tq4snWt9j+ pDcmMUC0WNOzH565e/bqlNI0GNvvatSRa+F28/L/kkT0fhHWDTR1OUjU+uo572r0jYIA N/PnL8aZJUxKQkzft7uADTHqjDnuvmPgw5StKhTP/VHlib0XJ0BFJTDq4LqkedckGJ+k T47oa8OSLTAcf7ye9Vn0JEQOqPxEYKOzRO2DkS9m/p8zfQCuGuixBWneXsy8jg8tGpr9 jhPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=K9oAGTjKChQm2OJo8U+xqv1fWpHPYGK0LIcmIVeAvZQ=; b=vcMtEY2pCusaOdddb4HiIbFvfO/9rhpaypsZXJm+Pb1fl9pQgpGI2OWYv8pX4MdJXp 65Hymllm33mTPpTYYBfFQ4jYx7RfxFYkrHQVjA2gM+CJZHsnEzovCQ0+ct8tWWgzemvg tGu/UxCQn3Tidl3lv0nHpGC+NJYW2BMH6vR+CVqWnlRX1rwFsSJZFohYCNwLLwBaYVV3 8I7uKM+7J8e+WvD3+qd7Q2gJ1f5eO7SY+F0ibRBiLoZXnjSeRseMkh6hQlWT8+ZBQ87m ym32dtdn63oLc4REw6HTloSkDCucHXrc0CTpwFEZrzC1TDOBKowVUYxv978rLfV2V1mn NLng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r11-20020a170902e3cb00b0016be96dc614si5005649ple.493.2022.07.05.04.18.19; Tue, 05 Jul 2022 04:18:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiGEKVr (ORCPT + 99 others); Tue, 5 Jul 2022 06:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232322AbiGEKVf (ORCPT ); Tue, 5 Jul 2022 06:21:35 -0400 X-Greylist: delayed 600 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 05 Jul 2022 03:21:32 PDT Received: from mg.ssi.bg (mg.ssi.bg [193.238.174.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6147E140C7; Tue, 5 Jul 2022 03:21:32 -0700 (PDT) Received: from mg.ssi.bg (localhost [127.0.0.1]) by mg.ssi.bg (Proxmox) with ESMTP id 804B728C44; Tue, 5 Jul 2022 13:06:01 +0300 (EEST) Received: from ink.ssi.bg (unknown [193.238.174.40]) by mg.ssi.bg (Proxmox) with ESMTP id 1D85628BBA; Tue, 5 Jul 2022 13:05:58 +0300 (EEST) Received: from ja.ssi.bg (unknown [178.16.129.10]) by ink.ssi.bg (Postfix) with ESMTPS id 23C2E3C0437; Tue, 5 Jul 2022 13:05:56 +0300 (EEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by ja.ssi.bg (8.17.1/8.16.1) with ESMTP id 265A5tFs007839; Tue, 5 Jul 2022 13:05:56 +0300 Date: Tue, 5 Jul 2022 13:05:54 +0300 (EEST) From: Julian Anastasov To: Christophe JAILLET cc: Simon Horman , Pablo Neira Ayuso , linux-kernel , kernel-janitors@vger.kernel.org, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org Subject: Re: [PATCH] netfilter: ipvs: Use the bitmap API to allocate bitmaps In-Reply-To: <420d8b70560e8711726ff639f0a55364e212ff26.1656962678.git.christophe.jaillet@wanadoo.fr> Message-ID: References: <420d8b70560e8711726ff639f0a55364e212ff26.1656962678.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, 4 Jul 2022, Christophe JAILLET wrote: > Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. > > It is less verbose and it improves the semantic. > > Signed-off-by: Christophe JAILLET Looks good to me for -next! Thanks! Acked-by: Julian Anastasov > --- > net/netfilter/ipvs/ip_vs_mh.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/net/netfilter/ipvs/ip_vs_mh.c b/net/netfilter/ipvs/ip_vs_mh.c > index da0280cec506..e3d7f5c879ce 100644 > --- a/net/netfilter/ipvs/ip_vs_mh.c > +++ b/net/netfilter/ipvs/ip_vs_mh.c > @@ -174,8 +174,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s, > return 0; > } > > - table = kcalloc(BITS_TO_LONGS(IP_VS_MH_TAB_SIZE), > - sizeof(unsigned long), GFP_KERNEL); > + table = bitmap_zalloc(IP_VS_MH_TAB_SIZE, GFP_KERNEL); > if (!table) > return -ENOMEM; > > @@ -227,7 +226,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s, > } > > out: > - kfree(table); > + bitmap_free(table); > return 0; > } > > -- > 2.34.1 Regards -- Julian Anastasov