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