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=-6.3 required=3.0 tests=BAYES_00, BUG6152_INVALID_DATE_TZ_ABSURD,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 BD92CC2D0A3 for ; Fri, 6 Nov 2020 08:18:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DF3E208B3 for ; Fri, 6 Nov 2020 08:18:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yhXy6gcG"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="U8exzy41" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbgKFISo (ORCPT ); Fri, 6 Nov 2020 03:18:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbgKFISn (ORCPT ); Fri, 6 Nov 2020 03:18:43 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C507C0613CF; Fri, 6 Nov 2020 00:18:43 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1604650719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QGCORwOg18faQgRDXRDoAOZ5EtYvujQ10ImekmNwcQs=; b=yhXy6gcGmWFYE01h4/TKk+zrZMwg42xeYL5EUEXrb/RFZqSPqPEU3d8FmcRj2+pfwXGvFj z8y+me8VUStg/owSsrgKg8p8UcnFt5DyjSWcw9GevRo3g1tS23PSqYYVqrzsGEOZEbqBpd RrlWTfFz/pZA60DTh4d4NGZ6t3P5v8b6cISt3xSTj4/YFU3aBd8QwCAwBQvpSneS5nKp4A bvZCmb6ZS/Rbynvd9f2zQ7RmG6J5Ni2Uf+LN08BM6J0OQ2RZWA3TfcjmQdD1PE+q2QJNcl BNfBbe5e04PD3Eso/jQay04n7Lz/8HzluPHNAVJBQE7samIBwTHasHdvKEq0pA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1604650719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QGCORwOg18faQgRDXRDoAOZ5EtYvujQ10ImekmNwcQs=; b=U8exzy41HYahMJICgu/66bCwCM/tiCv6nQvZZF+FdfyNJz3NGeeThwe7sRCmcxB07M0B4y jR82KoHtmLvI1EDA== To: Lukas Bulwahn , Petr Mladek , Sergey Senozhatsky , Steven Rostedt Cc: Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, kernel-janitors@vger.kernel.org, linux-safety@lists.elisa.tech, Lukas Bulwahn Subject: Re: [PATCH] printk: remove unneeded dead-store assignment In-Reply-To: <20201106034005.18822-1-lukas.bulwahn@gmail.com> References: <20201106034005.18822-1-lukas.bulwahn@gmail.com> Date: Fri, 06 Nov 2020 09:24:38 +0106 Message-ID: <87h7q2j3tt.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-11-06, Lukas Bulwahn wrote: > make clang-analyzer on x86_64 defconfig caught my attention with: > > kernel/printk/printk_ringbuffer.c:885:3: warning: > Value stored to 'desc' is never read [clang-analyzer-deadcode.DeadStores] > desc = to_desc(desc_ring, head_id); > ^ > > Commit b6cf8b3f3312 ("printk: add lockless ringbuffer") introduced > desc_reserve() with this unneeded dead-store assignment. > > As discussed with John Ogness privately, this is probably just some minor > left-over from previous iterations of the ringbuffer implementation. So, > simply remove this unneeded dead assignment to make clang-analyzer happy. > > As compilers will detect this unneeded assignment and optimize this anyway, > the resulting object code is identical before and after this change. > > No functional change. No change to object code. > > Signed-off-by: Lukas Bulwahn Reviewed-by: John Ogness