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=-14.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham 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 CE429C433DF for ; Thu, 4 Jun 2020 19:40:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 911862075B for ; Thu, 4 Jun 2020 19:40:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="khjHaUxx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 911862075B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 162B5280001; Thu, 4 Jun 2020 15:40:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 112D08E0006; Thu, 4 Jun 2020 15:40:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0277F280001; Thu, 4 Jun 2020 15:40:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id DE3738E0006 for ; Thu, 4 Jun 2020 15:40:23 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9A927824556B for ; Thu, 4 Jun 2020 19:40:23 +0000 (UTC) X-FDA: 76892545926.25.wood66_1e14df326d99 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 748011804E3A1 for ; Thu, 4 Jun 2020 19:40:23 +0000 (UTC) X-HE-Tag: wood66_1e14df326d99 X-Filterd-Recvd-Size: 5806 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 19:40:22 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id r10so3962045pgv.8 for ; Thu, 04 Jun 2020 12:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kJllNW+A+qSZYDyNUy0KaOA5QFyWsX/L5wjqGF/eTNE=; b=khjHaUxxHWq27mRVrCP90N/AIWBHw0Raqt4MSawehwogpV8OkvENICvoOfJVZkx0HE hNogTV16/NwZXxCOSGv2dPerVjZRRpPeRIGxaNDeieFVvkNGOsQPbUA4jVsw+RGMJM/1 DZ4Ka7WSW9usbnCAubZ33uZYz1CuVXU1e5wwsVkAh0ownQvTfrX26uwpcMSg4c4FVlB9 J0MlT9xW0GEK1fvgfb3wjQTvPWdI4UdS6GZdlbET89acNH1Dsv7O3JvR2loOOenQdzRS 7VBqB+LvcFYGppvlPdjlWc/cGF5adEw1HB5y4y0ezzkfiCva7K4+HnNEtlnj/NWpd7fY 2hVA== 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:content-transfer-encoding; bh=kJllNW+A+qSZYDyNUy0KaOA5QFyWsX/L5wjqGF/eTNE=; b=ibW7aCAr1Xrs5QuDJivBLJ1gjuI3zfK4nDu9WTe0QfycPV8WEMVBMb2mzenBRVH5Q5 mVjHUCy3JTZqMAMlI5SiFYDoL9+Bnetu4NIEpTYarSaL99Ega8G8rDssKDUjNfpSv63g HipLbt3R1YM90zLSzBKEgnFgQZVgQAcXd9EXS03KwCpmQxlF9Bd9qzXFIDkYRUI7IsMB LK7i0cflYLDzuai14Y+epZrzQ5OKoaNuEHOUHP7aR2FlxseIT4eMajeOxwVQO2QWkIb8 2AZeU4thlk3O0FTA1TYYri6U2woZLTLG/Hep6aJUpNudyLhowavS5jjkGPdymwn6ufe5 6oVw== X-Gm-Message-State: AOAM5321V1dV4EYGlwKTqH6XpfrBOh8YhF/dh5K0bK7osK950ToQnWr2 AvApl+WGOhR34kBEfpQsHmGf1bbRgKeAlEZnWeFyjQ== X-Google-Smtp-Source: ABdhPJyYElZ0dKBuAEJ4uM9aYg7zNwG3YltGgh77s2eCEowEEsdqVj0Qq+w+v4Ujopd3NJrASj7ulK+YFsUqdUSAiYg= X-Received: by 2002:a63:5644:: with SMTP id g4mr5715275pgm.381.1591299621501; Thu, 04 Jun 2020 12:40:21 -0700 (PDT) MIME-Version: 1.0 References: <20200603233203.1695403-1-keescook@chromium.org> <20200603233203.1695403-8-keescook@chromium.org> In-Reply-To: <20200603233203.1695403-8-keescook@chromium.org> From: Nick Desaulniers Date: Thu, 4 Jun 2020 12:40:09 -0700 Message-ID: Subject: Re: [PATCH 07/10] spi: davinci: Remove uninitialized_var() usage To: Kees Cook Cc: LKML , Linus Torvalds , Miguel Ojeda , Alexander Potapenko , Joe Perches , Andy Whitcroft , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, b43-dev@lists.infradead.org, Network Development , linux-wireless , linux-ide@vger.kernel.org, linux-clk@vger.kernel.org, linux-spi@vger.kernel.org, Linux Memory Management List , clang-built-linux , mporter@ti.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 748011804E3A1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 3, 2020 at 4:32 PM 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. As a precursor > to removing[2] this[3] macro[4], just remove this variable since it was > actually unused: > > drivers/spi/spi-davinci.c: In function =E2=80=98davinci_spi_bufs=E2=80=99= : > drivers/spi/spi-davinci.c:579:11: warning: unused variable =E2=80=98rx_bu= f_count=E2=80=99 [-Wunused-variable] > 579 | unsigned rx_buf_count; > | ^~~~~~~~~~~~ > > [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.co= m/ > [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=3D1TGqCR5vQkCzWJ0QxK6Cern= OU6eedsudAixw@mail.gmail.com/ > [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz= 9knmPuXhOeg@mail.gmail.com/ > [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=3DyVJu65TpLg= N_ybYNv0VEOKA@mail.gmail.com/ > > Signed-off-by: Kees Cook Reviewed-by: Nick Desaulniers Fixes 048177ce3b39 ("spi: spi-davinci: convert to DMA engine API") > --- > drivers/spi/spi-davinci.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c > index f71c497393a6..f50c0c79cbdf 100644 > --- a/drivers/spi/spi-davinci.c > +++ b/drivers/spi/spi-davinci.c > @@ -576,7 +576,6 @@ static int davinci_spi_bufs(struct spi_device *spi, s= truct spi_transfer *t) > u32 errors =3D 0; > struct davinci_spi_config *spicfg; > struct davinci_spi_platform_data *pdata; > - unsigned uninitialized_var(rx_buf_count); > > dspi =3D spi_master_get_devdata(spi->master); > pdata =3D &dspi->pdata; > -- > 2.25.1 > > -- > 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/msgi= d/clang-built-linux/20200603233203.1695403-8-keescook%40chromium.org. --=20 Thanks, ~Nick Desaulniers