From patchwork Fri Nov 6 06:22:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 11886185 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADF5514B4 for ; Fri, 6 Nov 2020 06:22:23 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D7BE5206F9 for ; Fri, 6 Nov 2020 06:22:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="ac5Wl7O3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7BE5206F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+142+4688437+8417402@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id 6n2rYY4689772x62L61Y0EHv; Thu, 05 Nov 2020 22:22:22 -0800 X-Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web08.8104.1604643741506491196 for ; Thu, 05 Nov 2020 22:22:21 -0800 X-Received: by mail-wm1-f65.google.com with SMTP id c16so268862wmd.2 for ; Thu, 05 Nov 2020 22:22:21 -0800 (PST) X-Gm-Message-State: 7D3Zs1LNDv1uMEUWZW9mVcUbx4688437AA= X-Google-Smtp-Source: ABdhPJw1kNpLxAin7EGLXZO9jr3KRSf4YMHdtk5JEmho3ZDLTxUMoNc/quG7fq3c5nak5We4cIg9ig== X-Received: by 2002:a1c:a503:: with SMTP id o3mr613462wme.21.1604643739995; Thu, 05 Nov 2020 22:22:19 -0800 (PST) X-Received: from felia.fritz.box ([2001:16b8:2d20:9d00:b87b:b644:61a3:6870]) by smtp.gmail.com with ESMTPSA id h81sm612401wmf.44.2020.11.05.22.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 22:22:19 -0800 (PST) From: "Lukas Bulwahn" To: Balbir Singh Cc: Tom Rix , Nathan Chancellor , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-janitors@vger.kernel.org, linux-safety@lists.elisa.tech, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [linux-safety] [PATCH] taskstats: remove unneeded dead assignment Date: Fri, 6 Nov 2020 07:22:10 +0100 Message-Id: <20201106062210.27920-1-lukas.bulwahn@gmail.com> Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech Delivered-To: mailing list linux-safety@lists.elisa.tech List-Post: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1604643742; bh=hSFdgMgbux8f4ya2htPv0TbPhS18pDSFg4ECvR+VXf8=; h=Cc:Date:From:Subject:To; b=ac5Wl7O3QyqHVNI+C1Ji8YBZoGGh5qevJDmBPpKy6nUQRWnwngtAY+eu9pBSdxxBATv qSlfTA0OsQ4sd8hKyXhIDlfU3N1Td5cpYgs98HxWcLjaWBWrtfX+MaYLvQ0E5iL/kYFlV CWHqw6q5dEU4w6Irux+VY9a5XaJK2cNs/Hk= make clang-analyzer on x86_64 defconfig caught my attention with: kernel/taskstats.c:120:2: warning: Value stored to 'rc' is never read \ [clang-analyzer-deadcode.DeadStores] rc = 0; ^ Commit d94a041519f3 ("taskstats: free skb, avoid returns in send_cpu_listeners") made send_cpu_listeners() not return a value and hence, the rc variable remained only to be used within the loop where it is always assigned before read and it does not need any other initialisation. So, simply remove this unneeded dead initializing assignment. 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: Nathan Chancellor --- applies cleanly on current master and next-20201105 Balbir, please pick this minor non-urgent clean-up patch. kernel/taskstats.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/taskstats.c b/kernel/taskstats.c index a2802b6ff4bb..bd18a7bf5276 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c @@ -117,7 +117,6 @@ static void send_cpu_listeners(struct sk_buff *skb, genlmsg_end(skb, reply); - rc = 0; down_read(&listeners->sem); list_for_each_entry(s, &listeners->list, list) { skb_next = NULL;