From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03DCB3242A4 for ; Sun, 23 Aug 2026 19:32:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.134.164.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787513564; cv=none; b=DjDeuNE1K8Wb0GqwKaFC0Mwh/lrPj0psqBUyy7d9jx60Zc/3m4Y13QekIc30VUvf0zlcVOwWWeG7YBk3wsl7Io1WKaSn5TkjGVHGgVNtetjX5hHlhsv6n4tL2+2ZGcucsxERNvdTBYcHNrPMGcjj5pjW9Z2iGoIki7ClBwvu/F8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787513564; c=relaxed/simple; bh=hvVPUJB7F/k5fYYcfth5jzmZJah8fhPYkfVIHJ9sAkI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=DtUpog1i4k9/VgbKl5jrwV/jxiDIxOt/gRYyZT7/4jMzBHuKAwS1zTnSQpg7nBi5PedAzhgoINL0d8IovX6md0PDC4HQJBbB3cCSr7CyNkZAulsGpx3PUMfJaxb5JAP6zAgf5LjZ0+3wrrICra97NlYjQyUHpGs382noDBH+oEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr; spf=pass smtp.mailfrom=inria.fr; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b=qr7PA1+e; arc=none smtp.client-ip=192.134.164.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="qr7PA1+e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=RIDPl9unTqh3/j6eZq3uLYNyg6i9YaspRc2c/8REKvo=; b=qr7PA1+eETQNK5XScjhkWk4parQ0FES2IaJb7bYo+LX1lzTBsWe+5ArQ AavhEZLNi47aUvTNsL9ftp2Y3WPA4KGNSx5ZL4wbIGifcPRQN4SEdfN9h ST0tL7WgG1OORvPIL9AuCQEVTgzY5OFuuQnDFysTwd0D+M7w3d8nVEPGz Y=; X-CSE-ConnectionGUID: 7EZLx/i0RhK7NKphGzh+iA== X-CSE-MsgGUID: SDfPKePLRZaIEExqxVFhew== Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.25,239,1779141600"; d="scan'208";a="154809879" Received: from 88-188-149-159.subs.proxad.net (HELO hadrien.home) ([88.188.149.159]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2026 21:31:29 +0200 Date: Sun, 23 Aug 2026 21:31:28 +0200 (CEST) From: Julia Lawall To: Sang-Heon Jeon cc: Nicolas Palix , cocci@inria.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/7] coccinelle: zalloc-simple: drop the kmem_alloc rules In-Reply-To: <20260823161826.3805598-4-ekffu200098@gmail.com> Message-ID: <1a42788d-89a6-393d-a3aa-effee35f894@inria.fr> References: <20260823161826.3805598-1-ekffu200098@gmail.com> <20260823161826.3805598-4-ekffu200098@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Mon, 24 Aug 2026, Sang-Heon Jeon wrote: > - kmem_alloc() was removed by commit f078d4ea8276 > ("xfs: convert kmem_alloc() to kmalloc()") > > - kmem_zalloc() was removed by commit 10634530f7ba > ("xfs: convert kmem_zalloc() to kzalloc()") > > So drop the kmem_alloc rules. > > No functional change. Applied > > Signed-off-by: Sang-Heon Jeon > --- > .../coccinelle/api/alloc/zalloc-simple.cocci | 41 +------------------ > 1 file changed, 1 insertion(+), 40 deletions(-) > > diff --git a/scripts/coccinelle/api/alloc/zalloc-simple.cocci b/scripts/coccinelle/api/alloc/zalloc-simple.cocci > index d66c45356691..ae1d39e71e31 100644 > --- a/scripts/coccinelle/api/alloc/zalloc-simple.cocci > +++ b/scripts/coccinelle/api/alloc/zalloc-simple.cocci > @@ -35,7 +35,7 @@ statement S; > @@ > > * x = (T)\(kmalloc(E1, ...)\|vmalloc(E1)\|dma_alloc_coherent(...,E1,...)\| > - kmalloc_node(E1, ...)\|kmem_cache_alloc(...)\|kmem_alloc(E1, ...)\| > + kmalloc_node(E1, ...)\|kmem_cache_alloc(...)\| > devm_kmalloc(...,E1,...)\|kvmalloc(E1, ...)\|kvmalloc_node(E1,...)\); > if ((x==NULL) || ...) S > * memset((T2)x,0,E1); > @@ -88,15 +88,6 @@ statement S; > - x = (T)kmem_cache_alloc(E3,E4); > + x = (T)kmem_cache_zalloc(E3,E4); > | > -- x = kmem_alloc(E1,E2); > -+ x = kmem_zalloc(E1,E2); > -| > -- x = (T *)kmem_alloc(E1,E2); > -+ x = kmem_zalloc(E1,E2); > -| > -- x = (T)kmem_alloc(E1,E2); > -+ x = (T)kmem_zalloc(E1,E2); > -| > - x = devm_kmalloc(E2,E1,E3); > + x = devm_kzalloc(E2,E1,E3); > | > @@ -290,36 +281,6 @@ x << r4.x; > msg="WARNING: kmem_cache_zalloc should be used for %s, instead of kmem_cache_alloc/memset" % (x) > coccilib.report.print_report(p[0], msg) > > -//----------------------------------------------------------------- > -@r5 depends on org || report@ > -type T, T2; > -expression x; > -expression E1,E2; > -statement S; > -position p; > -@@ > - > - x = (T)kmem_alloc@p(E1,E2); > - if ((x==NULL) || ...) S > - memset((T2)x,0,E1); > - > -@script:python depends on org@ > -p << r5.p; > -x << r5.x; > -@@ > - > -msg="%s" % (x) > -msg_safe=msg.replace("[","@(").replace("]",")") > -coccilib.org.print_todo(p[0], msg_safe) > - > -@script:python depends on report@ > -p << r5.p; > -x << r5.x; > -@@ > - > -msg="WARNING: kmem_zalloc should be used for %s, instead of kmem_alloc/memset" % (x) > -coccilib.report.print_report(p[0], msg) > - > //----------------------------------------------------------------- > @r6 depends on org || report@ > type T, T2; > -- > 2.43.0 > >