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.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 74BAEC433E0 for ; Thu, 4 Jun 2020 13:23:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 394DE20823 for ; Thu, 4 Jun 2020 13:23:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Z1SifWi8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 394DE20823 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BDBC6280001; Thu, 4 Jun 2020 09:23:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B8BFE8E0006; Thu, 4 Jun 2020 09:23:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5365280001; Thu, 4 Jun 2020 09:23:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id 886CF8E0006 for ; Thu, 4 Jun 2020 09:23:09 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 41879181AEF0B for ; Thu, 4 Jun 2020 13:23:09 +0000 (UTC) X-FDA: 76891595298.27.lock56_8fe854b4cb205 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 2CC6E3D682 for ; Thu, 4 Jun 2020 13:23:09 +0000 (UTC) X-HE-Tag: lock56_8fe854b4cb205 X-Filterd-Recvd-Size: 4814 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 13:23:08 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id u17so5164983qtq.1 for ; Thu, 04 Jun 2020 06:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Zd56CSP9N2M4FrfN9ySWd7Nzjr+sOLOVU8sX9ZsvxYk=; b=Z1SifWi8Glj9s1ZlViEQIoOzrtW4kQqhJPAuBmH8BuAfTlSORzOP5/aBkVIpDCF065 4tet6nf/xexKbX9HERYTEiH7bvvMa7jEzJZJ+Y9NbTVNdXZMe5cuQGHU5U8XYpc6rEpA 0M5eGOL/GQzV1R+AsSeBTDbzXk+YExg+XOlZLmxAbhKhBOAjkHQZ06AbVHRZdzvZiU7w cHe+L3V8vNXxybekuzSoIvOp1xxWvK8SbdjJVplyLz5vYnbOtUIAIDcZULCyq5qUdBWf hegDa8ghfSlITKfZUXou8d2OJHz3pI/kZh5/E9mjrrfnPUc08cS9ulbxQPmbEBYY1pID +u9g== 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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Zd56CSP9N2M4FrfN9ySWd7Nzjr+sOLOVU8sX9ZsvxYk=; b=b3qXjZhz4koVeobBKi5UhK0Q4wCDL8EVmcJPD95jdktOk1A70LfD4E/zNsO9wyDnoR 6q2cp/pTg/8h3ujVU/Ar/JmdNPjaUhDBmTciQaiFI0045WuZ9/nfnw5QfMm52EShzGcv F9rmpcdkqCnH516OxSNRW/5bdDZAXvMEC1EgGXOQN7bXmzx6q0F3R53lyGXX7XY12Ibn +2riEX4y42Is+FZoGNFJdL4a0i4c5NSJg8PWtMgYmOnrswq60bOf5yZvbZQarw4pJfpG VMdx6WA8tNam7f1kAlb/w5ZxNYWaQBtrZo27ZQ9xD1fZ/e70nCOg+BYKc+JVBDS0akKO 1GYw== X-Gm-Message-State: AOAM531sawKwqqg2DyOK92g+lbvzE/m7ltrrEkWXeIezLSFjxpUwKWQu pM7GzOzonB6rXORWE4N8OdzuUA== X-Google-Smtp-Source: ABdhPJxRZn/pXIUEkZhANETiTogTGf06kqn6Gs1x5NZFGFUPmFe5McyxpBqwN0tWHmbj+GOZ4kP/eQ== X-Received: by 2002:aed:3fa5:: with SMTP id s34mr4444014qth.343.1591276988114; Thu, 04 Jun 2020 06:23:08 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id 126sm4330150qkj.89.2020.06.04.06.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 06:23:07 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.93) (envelope-from ) id 1jgppq-001CIj-Sr; Thu, 04 Jun 2020 10:23:06 -0300 Date: Thu, 4 Jun 2020 10:23:06 -0300 From: Jason Gunthorpe To: Kees Cook Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Miguel Ojeda , Alexander Potapenko , Joe Perches , 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@googlegroups.com Subject: Re: [PATCH 09/10] treewide: Remove uninitialized_var() usage Message-ID: <20200604132306.GO6578@ziepe.ca> References: <20200603233203.1695403-1-keescook@chromium.org> <20200603233203.1695403-10-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200603233203.1695403-10-keescook@chromium.org> X-Rspamd-Queue-Id: 2CC6E3D682 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On Wed, Jun 03, 2020 at 04:32:02PM -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. > > I preparation for removing[2] the[3] macro[4], remove all remaining > needless uses with the following script: > > git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \ > xargs perl -pi -e \ > 's/\buninitialized_var\(([^\)]+)\)/\1/g; > s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;' > > drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid > pathological white-space. > > No outstanding warnings were found building allmodconfig with GCC 9.3.0 > for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64, > alpha, and m68k. At least in the infiniband part I'm confident that old gcc versions will print warnings after this patch. As the warnings are wrong, do we care? Should old gcc maybe just -Wno- the warning? Otherwise the IB bits look ok to me Acked-by: Jason Gunthorpe Jason