From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E03C0C07E96 for ; Tue, 13 Jul 2021 23:09:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B96A561351 for ; Tue, 13 Jul 2021 23:09:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236755AbhGMXMR (ORCPT ); Tue, 13 Jul 2021 19:12:17 -0400 Received: from smtprelay0070.hostedemail.com ([216.40.44.70]:49996 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235417AbhGMXMQ (ORCPT ); Tue, 13 Jul 2021 19:12:16 -0400 Received: from omf09.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 508902C5A4; Tue, 13 Jul 2021 23:09:25 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA id 7F83A1E04D8; Tue, 13 Jul 2021 23:09:24 +0000 (UTC) Message-ID: <42a843710a652e110b71ab6beafc3a3e6e11dfd3.camel@perches.com> Subject: Re: cocci script to convert linux-kernel allocs with BITS_TO_LONGS to bitmap_alloc From: Joe Perches To: Julia Lawall Cc: cocci , LKML , kernel-janitors@vger.kernel.org Date: Tue, 13 Jul 2021 16:09:22 -0700 In-Reply-To: References: <08b89608cfb1280624d1a89ead6547069f9a4c31.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Stat-Signature: uztexi7wie66gnpui9nawg7xurxs43hk X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 7F83A1E04D8 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19+E355a2jKrTaUCYH65AOx1cK8B6P3fac= X-HE-Tag: 1626217764-847900 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-07-13 at 23:33 +0200, Julia Lawall wrote: > > > On Fri, 9 Jul 2021, Joe Perches wrote: > > > > Here is a cocci script to convert various types of bitmap allocations > > > > that use BITS_TO_LONGS to the more typical bitmap_alloc functions. > > I see that there is also a bitmap_free. Maybe the rule should be > introducing that as well? Yes, but as far as I know, it's difficult for coccinelle to convert the kfree() calls of any previous bitmap_alloc to bitmap_free as most frequently the kfree() call is in a separate function. Please do it if you know how, you're probably the best in the world at coccinelle. I don't know how... cheers, Joe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D26FC07E95 for ; Wed, 14 Jul 2021 02:48:18 +0000 (UTC) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95B506136E for ; Wed, 14 Jul 2021 02:48:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95B506136E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=cocci-bounces@systeme.lip6.fr Received: from systeme.lip6.fr (systeme.lip6.fr [132.227.104.7]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 16E2mDgq007702; Wed, 14 Jul 2021 04:48:13 +0200 (CEST) Received: from systeme.lip6.fr (systeme.lip6.fr [127.0.0.1]) by systeme.lip6.fr (Postfix) with ESMTP id 9B556776E; Wed, 14 Jul 2021 04:48:13 +0200 (CEST) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by systeme.lip6.fr (Postfix) with ESMTPS id 3D0364065 for ; Wed, 14 Jul 2021 04:48:11 +0200 (CEST) Received: from smtprelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTPS id 16E2m9qj013773 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Wed, 14 Jul 2021 04:48:10 +0200 (CEST) Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave01.hostedemail.com (Postfix) with ESMTP id 7EEDA1854C070 for ; Tue, 13 Jul 2021 23:09:29 +0000 (UTC) Received: from omf09.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 508902C5A4; Tue, 13 Jul 2021 23:09:25 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA id 7F83A1E04D8; Tue, 13 Jul 2021 23:09:24 +0000 (UTC) Message-ID: <42a843710a652e110b71ab6beafc3a3e6e11dfd3.camel@perches.com> From: Joe Perches To: Julia Lawall Date: Tue, 13 Jul 2021 16:09:22 -0700 In-Reply-To: References: <08b89608cfb1280624d1a89ead6547069f9a4c31.camel@perches.com> User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 X-Stat-Signature: uztexi7wie66gnpui9nawg7xurxs43hk X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 7F83A1E04D8 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19+E355a2jKrTaUCYH65AOx1cK8B6P3fac= X-HE-Tag: 1626217764-847900 X-Greylist: Sender IP whitelisted, Sender e-mail whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Wed, 14 Jul 2021 04:48:14 +0200 (CEST) X-Greylist: Delayed for 02:59:58 by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Wed, 14 Jul 2021 04:48:10 +0200 (CEST) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 Cc: kernel-janitors@vger.kernel.org, cocci , LKML Subject: Re: [Cocci] cocci script to convert linux-kernel allocs with BITS_TO_LONGS to bitmap_alloc X-BeenThere: cocci@systeme.lip6.fr X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: cocci-bounces@systeme.lip6.fr Errors-To: cocci-bounces@systeme.lip6.fr On Tue, 2021-07-13 at 23:33 +0200, Julia Lawall wrote: > > > On Fri, 9 Jul 2021, Joe Perches wrote: > > > > Here is a cocci script to convert various types of bitmap allocations > > > > that use BITS_TO_LONGS to the more typical bitmap_alloc functions. > > I see that there is also a bitmap_free. Maybe the rule should be > introducing that as well? Yes, but as far as I know, it's difficult for coccinelle to convert the kfree() calls of any previous bitmap_alloc to bitmap_free as most frequently the kfree() call is in a separate function. Please do it if you know how, you're probably the best in the world at coccinelle. I don't know how... cheers, Joe _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci