Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1336802pxk; Thu, 10 Sep 2020 12:52:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqoG8dtKnnzq9p/bSNcsyOZGCuJ82D1gErAdCdAIB7dChnhXGEg0VHaZaSwZZ0g2lMvrIN X-Received: by 2002:a05:6402:1151:: with SMTP id g17mr11314992edw.227.1599767540658; Thu, 10 Sep 2020 12:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599767540; cv=none; d=google.com; s=arc-20160816; b=WLFRPniiCvqDk8fLNsp7bOXMARVFxhrWvR3hXX5LjVmgveYNoK8FKgH7l0gJQv2cJR Bmgc44e2rFowxa/K3IbYj8Xz2qf3Gp+5hGFfUsm7c0gX3tk9+ONhEHNCNjAODZW7R/6c 93NXyMKqNUdgo6oZOM2itly+kEcR9x6XAiMiFWnRxAASjC2Kqj946EHrfeKyOgOgZwUl 2OoNQfa43Vn04d+wJYl2vj/Cy50FRBXjmzkqEHCwsa3ne4WLs+uTU2DeGWhpHZdR1RtY BSXH5WaHAE4evDEp1vxgCgdSvnEeT+AhzkupaGC3RsVjQktn5VMg+x3T1KXBX7TfhDTv y/3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+cHRkT8sNFeWTbynGyxN3PPYP8ykbg0LglvItAS32tg=; b=lFXdHQnKYxca9o9u1In/rNJ19U9kxXMCRSyLxUsciJnpvpimotF6ksYl4rRwE6lCjx jNTmbpYUtXWkQ/FlpzNY0jWtYnYvv709t3OkGCAZY8HZSKvMN0NURqoppS2zIz3PprX/ Su9I+nidB7kNM44zMAeMTdWcHMFKEX2BAeH4yscsgyyOhrdg7T714A7YV+FEsuVhTDvK BhLqlGg+yvvOj9v2LpZBCEio9Hjr0QhcjXi9Gw0uEQ107L4rP1RBq/vEYpnDmvYM8drh OZfLwc0qWgg4M7TSjhqd7DBHyqwL3rVwcz2kVgrIACnvXtjPOYlLiCp0rIzhbkIAOzkQ +REg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e3QOW6li; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si4170482ejn.410.2020.09.10.12.51.58; Thu, 10 Sep 2020 12:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e3QOW6li; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbgIJTvX (ORCPT + 99 others); Thu, 10 Sep 2020 15:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbgIJTvL (ORCPT ); Thu, 10 Sep 2020 15:51:11 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEF66C061757 for ; Thu, 10 Sep 2020 12:51:10 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id d6so5307637pfn.9 for ; Thu, 10 Sep 2020 12:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+cHRkT8sNFeWTbynGyxN3PPYP8ykbg0LglvItAS32tg=; b=e3QOW6liZzQXG+Kv2AcwAesvbHXZXtz83QCDVvrluTaPKCOoFGrEp8/WJIbrbwBrvn h4scUnJ51PfrgEOp3GFTHmUzxVSBoQuw0WKCBUKih20chmEnh1bNIhopi9J3wcIWomN9 rieGPxZXAOcUJ9GBL/9QNZzYnFo7NmUnIfdY8= 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=+cHRkT8sNFeWTbynGyxN3PPYP8ykbg0LglvItAS32tg=; b=Oat6S2TeIaeSodslPA250dK37HS+4DiJy5p7VHntytLRjp+TZGDEJoGPllUNeosMUO ILGJ6abYNszT94D6r4w3f3uKsLFKa06rSsy3E5BGS+p2ZVdpCZQOGhj8czxeImbW6ZZN Xrd0Qse4mvFrMquD0HULXnmMreTDiKtaxjnq1qkmtV29nkRMNRP4OG1xxgKznaccV4Eg muFQP/fMhlQ5i+CR7l8hdMHTMTtHl57nEwc+J3K7dcQVFz/iWeH4g2g1w0cCHu3NBBxL GLuWQi2kGZlKAAWk9DvPec4Hmw+OXmTxtAt3ro9Za4abspBsYhS6oX+iIdWABrsumPry K13A== X-Gm-Message-State: AOAM532S4xrQAAvUT7N4CZHWi/N5A3JGzXQ3qHE2TkkvvmqvAAIe7Bd1 dp7LvNYmymJkRdfDxmiSoIVoMQ== X-Received: by 2002:aa7:9730:0:b029:13e:d13d:a091 with SMTP id k16-20020aa797300000b029013ed13da091mr7054551pfg.40.1599767470434; Thu, 10 Sep 2020 12:51:10 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l1sm6732890pfc.164.2020.09.10.12.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 12:51:09 -0700 (PDT) Date: Thu, 10 Sep 2020 12:51:08 -0700 From: Kees Cook To: Joe Perches Cc: Andrew Morton , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, "Gustavo A . R . Silva" , Denis Efremov , julia.lawall@inria.fr Subject: Re: [PATCH] checkpatch: Warn on self-assignments Message-ID: <202009101250.FBB416D@keescook> References: <20200811210127.11889-1-efremov@linux.com> <20200901094812.428896-1-efremov@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 05, 2020 at 10:58:29AM -0700, Joe Perches wrote: > The uninitialized_var() macro was removed recently via > commit 63a0895d960a ("compiler: Remove uninitialized_var() macro") > as it's not a particularly useful warning and its use can > "paper over real bugs". > > Add a checkpatch test to warn on self-assignments as a means > to avoid compiler warnings and as a back-door mechanism to > reproduce the old uninitialized_var macro behavior. > > Signed-off-by: Joe Perches I like it! :) Can you add a section to code style and include a link in the checkpatch warning to it? (Feel free to just reuse the text removed from deprecated.rst) -- Kees Cook