Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3656335pxu; Mon, 30 Nov 2020 07:40:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjEjHqMXYBIu9bJvjtkMx8j7fG47tL4M7oXFGo0TFSVgHf6bzYjzuNCrWJdGlFIJ8phheh X-Received: by 2002:a17:906:7f11:: with SMTP id d17mr9998577ejr.534.1606750856097; Mon, 30 Nov 2020 07:40:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606750856; cv=none; d=google.com; s=arc-20160816; b=QIrACVjS/xQJqFDThyZCdugABOIWu55yj8iXuVoOHCfrtFVTIbiNJ22fGELTyVTlK1 4rwlLFBmf+RVcQZfSaHiNh8hqJvj9LL7edVgoshW7gH5jFjxLLg65LBvUJHhO0qWmYG6 GkdBBsbfN3MiVNXNrmfXmsWGekBI044hR2RC4Ke3FJ2EuO6QcBNoMVdyNRpi5q9DMI7k q4nqPjW+KWh3QyPwxiTxnd2PHGT1DpEaiRjitEfq66rwulduCC5f4dp0yoO2MsoDNDSf +xaIeUjxaJcKu04FJAs44C5Tul16j1vQg9hZ8mnYzfTQN3DsDCHUuGQqD7S//x/sj5ne dELA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KtPZdWr+m2QwCVPUCkiJTsHf3OlVY3Ly9fgprsglCU4=; b=XN6yFXAnjrO8ApHMtghbaAFoC7CXGAwKEuw05uzSdOpOvRpWcTjZ2tim1/UA1jLLvq AX0IML1cTNZBZ7wuEzGLVHHSXDpgb+g3UYEJ8irWhcd/fiiBD6Ud93IYnfkMEZyaRLPo TwQYgVYkmMpF5kd152+j9uoPks9q1U7ViW9MxGremzeeCAulSxX9RsuGV+D79ilZime1 3+ycs3PPM0fN6rM8Oi2kKjYzf7PwN5NnVzYAzKIw+uZv8gwfrDd5TD90tt646fC9N4cs V5RVmTCF6DiLjUjKLnBHj1G5UZ3KGpH8vDDpXv42BclnkKrLZUEnl4brE7iPx6SzBbVV 3M6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=eUXvSWAP; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr6si10686107ejc.319.2020.11.30.07.40.31; Mon, 30 Nov 2020 07:40:56 -0800 (PST) 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=@suse.com header.s=susede1 header.b=eUXvSWAP; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728308AbgK3PiX (ORCPT + 99 others); Mon, 30 Nov 2020 10:38:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:47458 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbgK3PiV (ORCPT ); Mon, 30 Nov 2020 10:38:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1606750654; h=from:from:reply-to: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=KtPZdWr+m2QwCVPUCkiJTsHf3OlVY3Ly9fgprsglCU4=; b=eUXvSWAPyjvCrAeAgYzVyVd+FonqqypwesPOQe0sC6Z683Njv52cpm5d2tWLj4mSVEguSG HgzxczKhxfq/SjhoxDmzFIV6mDa+etZ507CQYynKGDFlY95N8RA2WIIxeGTwjyd8Z/83pQ Q7eoOo+V9ROvc8W8QmiVrkMnnePtQBE= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4CC7EADC5; Mon, 30 Nov 2020 15:37:34 +0000 (UTC) Date: Mon, 30 Nov 2020 16:37:33 +0100 From: Petr Mladek To: Lukas Bulwahn Cc: Sergey Senozhatsky , Steven Rostedt , John Ogness , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, kernel-janitors@vger.kernel.org, linux-safety@lists.elisa.tech Subject: Re: [PATCH] printk: remove obsolete dead assignment Message-ID: References: <20201130124915.7573-1-lukas.bulwahn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201130124915.7573-1-lukas.bulwahn@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2020-11-30 13:49:15, Lukas Bulwahn wrote: > Commit 849f3127bb46 ("switch /dev/kmsg to ->write_iter()") refactored > devkmsg_write() and left over a dead assignment on the variable 'len'. > > Hence, make clang-analyzer warns: > > kernel/printk/printk.c:744:4: warning: Value stored to 'len' is never read > [clang-analyzer-deadcode.DeadStores] > len -= endp - line; > ^ > > Simply remove this obsolete dead assignment here. > > Signed-off-by: Lukas Bulwahn > --- > applies cleanly on current master and next-20201130 > > Petr, please pick this minor non-urgent clean-up patch. > > kernel/printk/printk.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index f279d4fbd9dd..6e4e38b7cd91 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -741,7 +741,6 @@ static ssize_t devkmsg_write(struct kiocb *iocb, struct iov_iter *from) > if (LOG_FACILITY(u) != 0) > facility = LOG_FACILITY(u); > endp++; > - len -= endp - line; > line = endp; > } > } Yup, it was used to write the trailing '\0'. But it is done earlier now. So, it is not longer needed. Reviewed-by: Petr Mladek Best Regards, Petr PS: I'll give it few days just in case anyone else would want to review it. I'll push it then unless anyone complains.