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=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 AF044C433E1 for ; Thu, 4 Jun 2020 02:53:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7242B207D0 for ; Thu, 4 Jun 2020 02:53:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gV3DINCK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7242B207D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EC2E3280004; Wed, 3 Jun 2020 22:53:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E4C6380007; Wed, 3 Jun 2020 22:53:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1459280004; Wed, 3 Jun 2020 22:53:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id B6EB380007 for ; Wed, 3 Jun 2020 22:53:47 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6F928180AD804 for ; Thu, 4 Jun 2020 02:53:47 +0000 (UTC) X-FDA: 76890009294.07.chain04_2107e69694852 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 540491803FFCF for ; Thu, 4 Jun 2020 02:53:47 +0000 (UTC) X-HE-Tag: chain04_2107e69694852 X-Filterd-Recvd-Size: 7013 Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 02:53:46 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id r2so4705633ioo.4 for ; Wed, 03 Jun 2020 19:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=iPa6WDxkXnezV97Gv8ktsN2vMvnblioziS1zAvyim80=; b=gV3DINCKuZMpDCcJsHDr9sszAXGMneIMI9KCtZ/1A8KL8Ro8YmZMB8pbOf6XvwEEzL 3s/WZ64Ad1THwC1yIcoFtMfrjuy9MChcgCUeVc2yt6Fhqv5YnQlKfybyJa868B56C64R SpWLnoPhud5yWqrZVnmnqlgYyhjIfWw9LqP/fxle2AdjsoTo956wTTJnEH2/k/fpJpV8 AlEmkB8V6/jcUVOOJnMZ+E5Zm/eCneQHSejIbdNntpH48J0GSb9f7+yK1rM1n2Ds+iYc oegcVR8oOw7YMCXmQJAWTc+Zqvl8pQBXc+Tu4Mxm/lQXO2FR+n8tx0M6aLA2yfHxQbwF EZTA== 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:reply-to :from:date:message-id:subject:to:cc; bh=iPa6WDxkXnezV97Gv8ktsN2vMvnblioziS1zAvyim80=; b=eZDJamzQZcX+pUHmFBBnGv2+gL22aG8NZa4FYY3+LKhpYLoSK6/NkHJY2I2xh3ciXD 9QaBq/CIhzy7pTF/fKNAxECqrwb0W5UbQDr6jKI7zQNRV3ADOHCueCeE92GkcTmfOvLS RwcXlIiiwzQC/RNbQamZQ2MNTgWAn1DxVNxnXdF39GsQIJoCaEvEZMW3U5pG7tK41lYc q9Fk6MGDC/uCLK8ebejUOoIEvpYo31J8W1Kr4PSWg1ARlHz/od7Qt2m0lym+oUyKmwjN 0Spzlzmx8YPuhXdfyl6cG1YhyzETSY9MejfvcHRB5AIOlJDNO7PkrxZnZK2s0sgI6WTH pmqQ== X-Gm-Message-State: AOAM5315wIsHP2AJIL2WUt0/QEVpVK0uVCb1BpyTf0cEdBckWinP2Jhk j3tzlpcYJPTj04sweIjGji/MMwZZGVSQBXc0tLo= X-Google-Smtp-Source: ABdhPJySRKD1t147Rxyby0Eo8wAO+qnFmJBtx6pTIjJ6uS6L8CSs9GvotZtKdMSuFL1kS3zXMhEH8p9JZsy+Uo4RRkU= X-Received: by 2002:a05:6602:1616:: with SMTP id x22mr2465452iow.70.1591239226196; Wed, 03 Jun 2020 19:53:46 -0700 (PDT) MIME-Version: 1.0 References: <20200603233203.1695403-1-keescook@chromium.org> <20200603233203.1695403-9-keescook@chromium.org> <202006031838.55722640DC@keescook> <6f921002478544217903ee4bfbe3c400e169687f.camel@perches.com> <202006031944.9551FAA68E@keescook> In-Reply-To: <202006031944.9551FAA68E@keescook> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Thu, 4 Jun 2020 04:53:34 +0200 Message-ID: Subject: Re: [PATCH 08/10] checkpatch: Remove awareness of uninitialized_var() macro To: Kees Cook Cc: Joe Perches , linux-kernel@vger.kernel.org, Linus Torvalds , Miguel Ojeda , Alexander Potapenko , Andy Whitcroft , x86@kernel.org, drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, b43-dev@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-ide@vger.kernel.org, linux-clk@vger.kernel.org, linux-spi@vger.kernel.org, linux-mm@kvack.org, Clang-Built-Linux ML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 540491803FFCF X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Kees, can you push that change also to kees/linux.git#kspp/uninit/v5.7/macro ? Thanks in advance. Regards, - Sedat - [1] https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/log/?h=kspp/uninit/v5.7/macro On Thu, Jun 4, 2020 at 4:44 AM Kees Cook wrote: > > On Wed, Jun 03, 2020 at 06:47:13PM -0700, Joe Perches wrote: > > On Wed, 2020-06-03 at 18:40 -0700, Kees Cook wrote: > > > On Wed, Jun 03, 2020 at 05:02:29PM -0700, Joe Perches wrote: > > > > On Wed, 2020-06-03 at 16:32 -0700, Kees Cook wrote: > > > > > Using uninitialized_var() is dangerous as it papers over real bugs[1] > > > > > (or can in the future), and suppresses unrelated compiler warnings > > > > > (e.g. "unused variable"). If the compiler thinks it is uninitialized, > > > > > either simply initialize the variable or make compiler changes. > > > > > > > > > > In preparation for removing[2] the[3] macro[4], effectively revert > > > > > commit 16b7f3c89907 ("checkpatch: avoid warning about uninitialized_var()") > > > > > and remove all remaining mentions of uninitialized_var(). > > > > > > > > > > [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/ > > > > > [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/ > > > > > [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/ > > > > > [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ > > > > > > > > nack. see below. > > > > > > > > I'd prefer a simple revert, but it shouldn't > > > > be done here. > > > > > > What do you mean? (I can't understand this and "fine by me" below?) > > > > I did write "other than that"... > > > > I mean that the original commit fixed 2 issues, > > one with the uninitialized_var addition, and > > another with the missing void function declaration. > > > > I think I found the missing void function bit because > > the uninitialized_var use looked like a function so I > > fixed both things at the same time. > > > > If you change it, please just remove the bit that > > checks for uninitialized_var. > > Ah! Gotcha. Thanks; I will update it. > > -Kees > > > > > Thanks, Joe > > > > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > > > [] > > > > > @@ -4075,7 +4074,7 @@ sub process { > > > > > } > > > > > > > > > > # check for function declarations without arguments like "int foo()" > > > > > - if ($line =~ /(\b$Type\s*$Ident)\s*\(\s*\)/) { > > > > > + if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { > > > > > > > > This isn't right because $Type includes a possible trailing * > > > > where there isn't a space between $Type and $Ident > > > > > > Ah, hm, that was changed in the mentioned commit: > > > > > > - if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { > > > + if ($line =~ /(\b$Type\s*$Ident)\s*\(\s*\)/) { > > > > > > > e.g.: int *bar(void); > > > > > > > > Other than that, fine by me... > > > > > > Thanks for looking it over! I'll adjust it however you'd like. :) > > > > > > > -- > Kees Cook > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202006031944.9551FAA68E%40keescook.