From patchwork Wed Apr 3 22:00:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10884545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 837F613B5 for ; Wed, 3 Apr 2019 22:00:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D9FF2888A for ; Wed, 3 Apr 2019 22:00:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60B5A2894E; Wed, 3 Apr 2019 22:00:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 184D12888A for ; Wed, 3 Apr 2019 22:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726477AbfDCWAL (ORCPT ); Wed, 3 Apr 2019 18:00:11 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:33344 "EHLO mail-pf1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbfDCWAJ (ORCPT ); Wed, 3 Apr 2019 18:00:09 -0400 Received: by mail-pf1-f177.google.com with SMTP id i19so266686pfd.0 for ; Wed, 03 Apr 2019 15:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+OQrPPXAV2h4lAFwy0fm56E+XzdI5UXo33CV/ZPd/Q0=; b=az0QJVf7dkZhsWhCHX0IpMAud4qVEaJ9WMdBradQoKiQPzgnYvKU0y3EtXjfNN/emC T2Yvp5cg8uO+SVDJSzvk9r3B/410FLbYVBNVHzAMWAKbq8Kfv5gI95yQ1M3WCPEqJEHp 5LTFKe/Y3KeBexsu/48/7us94EZcczHYqENrKiIS2dVJDhF8SYRa7vL5siS0C4Gvcuq7 OkcutyDWybR3tFmh5+uMYvxKtcwr/sq6zPuFyA6FYCG0/AAvcZFN3yGfXpTPIFNoO9xV wFpYxGZ8Q8gAZ+15d4+DUjE11M1b6HPxTrgPhjEzvvt8BDoFUsU0nc4CdTDLzdo0YbUX XH+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+OQrPPXAV2h4lAFwy0fm56E+XzdI5UXo33CV/ZPd/Q0=; b=M12KChO6s4s5NLby3yEkD1TFc0ugEPtXBpzJYSfyBMbLbo+0psNpXqwrSR7sGTMAjd 7r3kWKOzKFHpJr2Nd09XyrCjWcp8dXybUiuWYGK7YH+yTKQC5XBmELEGe7+H/EkIsfVn 6euZgvChQIU3tKDAvxU/bXvTaHyFpRdMxJRhl3GhHkHPe2CMtUFpnAkKXBUHKtU7tPEg S+hPTn/2c/UTnCk1LWYW+wU5ONqz35KCfDh0ayeUnXmUjZ2vxKnyq+aT2mo+mwtjbFtr 5T1j6gcwLclgPwqJlITQHXfPwHkyom1Exs743y28RguQbrPV1yI0pvA/B9Yy6LdAO+wg ZvPg== X-Gm-Message-State: APjAAAUYJq7tds7uKCbu260I8Gm/OrCpKX2v49B3/NKmiQ6/xYIKVSh9 eW+9y3tPFWjYp+7i5AHAWUG+y1aY X-Google-Smtp-Source: APXvYqxBN04tp9vWGs8+p77Y47L+LoUblF1bRUI6j2g9rj4EvavrnTdjqp60rZ4YjJJ+W+WX35BjtQ== X-Received: by 2002:a65:5ac3:: with SMTP id d3mr2175709pgt.168.1554328808113; Wed, 03 Apr 2019 15:00:08 -0700 (PDT) Received: from dev-l ([149.28.200.39]) by smtp.gmail.com with ESMTPSA id c11sm26474929pgd.24.2019.04.03.15.00.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 15:00:07 -0700 (PDT) Date: Wed, 3 Apr 2019 15:00:06 -0700 From: Denton Liu To: Git Mailing List Subject: [PATCH 2/2] cocci: FLEX_ALLOC_MEM to FLEX_ALLOC_STR Message-ID: <78b6d3f58dc409477e801aa3d83e83ccee3841cb.1554328261.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ensure that a FLEX_MALLOC_MEM that uses 'strlen' for its 'len' uses FLEX_ALLOC_STR instead, since these are equivalent forms. Signed-off-by: Denton Liu --- contrib/coccinelle/flex_alloc.cocci | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 contrib/coccinelle/flex_alloc.cocci diff --git a/contrib/coccinelle/flex_alloc.cocci b/contrib/coccinelle/flex_alloc.cocci new file mode 100644 index 0000000000..e9f7f6d861 --- /dev/null +++ b/contrib/coccinelle/flex_alloc.cocci @@ -0,0 +1,13 @@ +@@ +expression str; +identifier x, flexname; +@@ +- FLEX_ALLOC_MEM(x, flexname, str, strlen(str)); ++ FLEX_ALLOC_STR(x, flexname, str); + +@@ +expression str; +identifier x, ptrname; +@@ +- FLEXPTR_ALLOC_MEM(x, ptrname, str, strlen(str)); ++ FLEXPTR_ALLOC_STR(x, ptrname, str);