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=0.7 required=3.0 tests=BAYES_05,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 562B5C433DF for ; Sun, 12 Jul 2020 07:18:52 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 0F22F2065F for ; Sun, 12 Jul 2020 07:18:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cZ/LSrVT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F22F2065F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id AE21E203B0; Sun, 12 Jul 2020 07:18:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id USRqLWZsZD0r; Sun, 12 Jul 2020 07:18:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 8F4F820445; Sun, 12 Jul 2020 07:18:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 744A7C088E; Sun, 12 Jul 2020 07:18:50 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3D2E8C0733 for ; Sun, 12 Jul 2020 07:18:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 244AC88E2C for ; Sun, 12 Jul 2020 07:18:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PXpUCZRuPG+3 for ; Sun, 12 Jul 2020 07:18:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id AD47488E27 for ; Sun, 12 Jul 2020 07:18:47 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id l1so10305582ioh.5 for ; Sun, 12 Jul 2020 00:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yG1pahNzbMAPYy42ALb72+WSdCrPtx9HHEWdOjujfbM=; b=cZ/LSrVT+6aNxSC/xLgsy21Wi/cxerf3AyaldpRngSbv6zlOWV3pJbSMA+W8JqoZrB JHY3itDFz6Tl+nnV4K8MSrc2o/gI7o/XKi+hEuNciTvM6svCcWvqmF3hLatYFdaJWbSe +jrwhYDRZ3OZ5xa6YNNAiabj4QVdFno9iSiI94n26Dq7tOi1IOxRgqOjXKtZdi08xMKN nmIlRWP4RmzOhmNa29CrY3r7X+DpdhtaG5HJkuTCe2me7smik06eXGG2lBYRc9wY6QvO 5C/XjiFeTC0prHHf/JznNuJW0PxBbdt41UiJEdRh7+2GFjPy2TC3NMpIXnsWxZHRI1tm FDOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yG1pahNzbMAPYy42ALb72+WSdCrPtx9HHEWdOjujfbM=; b=as4XFbau6Q0L7pUzQK2jrlfcFdsEyfswEAX+jRdCB8BAWZNo0xJrd/Ty4w9F/ORZSr jaVsCMggTumLlZODlBNDUa+5SG9HNLXGujtZls+E/ldTMPnjIwq8jGMFjxBpOnBglJd6 irKkU1s9abG/g9r0RvIj0BFzQjHTKI6r3+23RC9hghxnkhuemPJhaeog7p+TvwUNBZdP bxXSAeQiarW0OGBjTAvKaIS63HvCbfxjH0ToWEmhLrK5XxeRqg+FOck32WAqBiCMekfT u8WSOzyf7Ov7PZxoNnSvgrWd1an0PaC4A8U59MOIkhfHcs1R+6BlfuYNR1cU57opxIx7 aVDw== X-Gm-Message-State: AOAM532ixjetV1EdIV6sI4gW8BR3m1DAEyAX0TDkNXbLIS5YmTCIlIta xVY3LEnbeVf1lxaiQ34vss5ggGVeHuPhWBWdJCw= X-Google-Smtp-Source: ABdhPJzDd0KO7vdEfelFzSHHcX9KNMs3N7ch83s/43n6PTuL1pvmrxpx0rToMrscn3F+PPb0McBRTp/dbJTdlCsx6nI= X-Received: by 2002:a6b:5c07:: with SMTP id z7mr56810358ioh.140.1594538326984; Sun, 12 Jul 2020 00:18:46 -0700 (PDT) MIME-Version: 1.0 References: <20200711154415.34w6ndu24uodj3ba@mrinalpandey> In-Reply-To: From: Lukas Bulwahn Date: Sun, 12 Jul 2020 09:18:36 +0200 Message-ID: To: Mrinal Pandey Cc: Linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [Linux-kernel-mentees] [PATCH] checkpatch: Fix the usage of capture group ( ... ) X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6050648443596555777==" Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" --===============6050648443596555777== Content-Type: multipart/alternative; boundary="0000000000008f89b205aa396228" --0000000000008f89b205aa396228 Content-Type: text/plain; charset="UTF-8" On Sun, Jul 12, 2020 at 7:18 AM Mrinal Pandey wrote: > On Sun, Jul 12, 2020 at 12:44 AM Lukas Bulwahn > wrote: > >> >> >> On Sat, Jul 11, 2020 at 5:44 PM Mrinal Pandey >> wrote: >> >>> The usage of "capture group (...)" in the immediate condition after `&&` >>> results in `$1` being uninitialized. This eventually crashes the script. >>> >>> >> It does not really crash it, right? It just emits a warning. >> > > Sir, > > Yes. I will modify the line accordingly. > >> >> >>> Fix this by placing the capture group in the condition before `&&`. >>> Thus, `$1` can be initialized to the text it matches thereby setting it >>> to the desired and required value. >>> >>> >> Maybe you can look when this bug was introduced? >> > > The bug was first introduced with the commit `e518e9a59ec3` when the block > was > added to the script. It has been like that since then. > Should I add this detail too in the commit message? > Yes, please do. Commits are referred to with its hash shortened to 12 characters and the commit message header in the following format: Commit e518e9a59ec3 ("checkpatch: emit an error when there's a diff in a changelog") Further note: - can you also explain what the author intended to do? - can you describe in one sentence how you discovered this bug? - use checkpatch.pl on your own patch. Please rework the commit message and resend to this list, Shuah and me. I think if that patch is then okay, we have a quick look and then you can send it out to the general list. Lukas > --0000000000008f89b205aa396228 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Jul 12, 2020 at 7:18 AM Mrina= l Pandey <mrina= lmni@gmail.com> wrote:
On Sun, Jul 12, 2020 at 12:= 44 AM Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:


On Sat, Jul 11, 2020 at 5:44 PM Mrinal Pandey <= mrinalmni@gmail.co= m> wrote:
The usage of "capture group (...)" in the immediate condition af= ter `&&`
results in `$1` being uninitialized. This eventually crashes the script.

It does not really crash it, right? It= just emits a warning.

Si= r,

Yes. I will modify the line accordingly.
=C2=A0
Fix this by placing the capture group in the condition before `&&`.=
Thus, `$1` can be initialized to the text it matches thereby setting it
to the desired and required value.


Maybe you can look when this bug was i= ntroduced?

The bug was fi= rst introduced with the commit `e518e9a59ec3` when the block was
= added to the script. It has been like that since then.
Should I a= dd this detail too in the commit message?

Yes, please do.

Commits are r= eferred to with its hash shortened to 12 characters and the commit message = header in the following format:

Commit e518e9a59ec= 3 ("checkpatch: emit an error when there's a diff in a changelog&q= uot;)


Further note:
-= can you also explain what the author intended to do?
- can you d= escribe in one sentence how you discovered this bug?
- use checkpatch.pl on your own = patch.

Please rework the commit message and re= send to this list, Shuah and me.

I think if th= at patch is then okay, we have a quick look and then you can send it out to= the general list.


Lukas
--0000000000008f89b205aa396228-- --===============6050648443596555777== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees --===============6050648443596555777==--