From patchwork Sun Oct 3 11:41:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nghia Le X-Patchwork-Id: 12532689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1271C433EF for ; Sun, 3 Oct 2021 11:41:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 74D2061214 for ; Sun, 3 Oct 2021 11:41:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 74D2061214 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AD213900002; Sun, 3 Oct 2021 07:41:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A80DB6B0071; Sun, 3 Oct 2021 07:41:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 947E1900002; Sun, 3 Oct 2021 07:41:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 854D06B006C for ; Sun, 3 Oct 2021 07:41:42 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 20D0D2D3B4 for ; Sun, 3 Oct 2021 11:41:42 +0000 (UTC) X-FDA: 78654936444.04.2E3CC38 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf24.hostedemail.com (Postfix) with ESMTP id C8BE5B000D55 for ; Sun, 3 Oct 2021 11:41:41 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id np13so3325267pjb.4 for ; Sun, 03 Oct 2021 04:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/D8bXyu49DxBdYOqHuSui3s+tc6MfuSn1HC3CjVWP6g=; b=l3/+qZ+lxn3ZuJlc69ANU1xZBUFyjznJ/dhb5dnFZVdSQ6HSE+KfbSegxcLYg5Hclx yk+jTUbwXtdJ1i3Ta7MkC1dYj/VU422S7zXSRcLo47vfYzEWjmfB73PKT9C3TpDc6ule Czeo7Ee0CSGlfe0ghoqVFLiQmUHG4S7UEySK5SDhF2eHoenmBw36f60g6468/0yY9RTx wS2GbwToeD3CD4wtdyuoBnaDkPG33H5U/zNEVkll0EWIaRitIN3EHraSxCBbcH3KHtfd 7+E0ELX49iOjLVArhmmAAMLe7rqvDzS+L+E6KZCClR2wvU38LSby6Ht7kpKPtHI3AvM8 sX8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/D8bXyu49DxBdYOqHuSui3s+tc6MfuSn1HC3CjVWP6g=; b=13p++M38Xfot9Ot0gwgq6zkyQbFhwtpJMAqPGQjbHTl0HTdFzV0D2eKIwlVWF562r0 3eJ18dNPnR97oG9gwaW+v1KBmIZpGiFGcFXdM+BSpGZhjHlxNCX2+aemoV+NG6jUguvM OYsMLEfw6X6prPngtEVFHg87HidUaIdCTGoVS2WY3m6vqyN0mrD2C6qSccveFuI3RbH2 RifTATakToYG13kRkKhGngWIMPFBtm2D+iAjUiA5AB6y4fXIVWzgRhni08D1i/cZ2sWW Qg4CcWw7Au5ANCeDLF3IRJ5t/DfXCWHzjymCdoe7d2TvxwPbQCOMJECrmTMZ/IGm6AiF 0x6A== X-Gm-Message-State: AOAM53254WEkbl4MpNT0A9PGV7hMpKUb4nvnSqbL+tLUylXSyZNtdGK1 1r+krfEZBKqOf4lSz8ivmzU= X-Google-Smtp-Source: ABdhPJzEXo5XpNXHFNgCL+WuGLFf0o5O5/LmEBJzprQr6lzDPqEAs4lqCoAZYlQZi2cIIC1OjnsqKw== X-Received: by 2002:a17:90b:1d84:: with SMTP id pf4mr8614263pjb.107.1633261300673; Sun, 03 Oct 2021 04:41:40 -0700 (PDT) Received: from ubuntu.localdomain ([171.224.177.7]) by smtp.gmail.com with ESMTPSA id d5sm10071574pjs.53.2021.10.03.04.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 04:41:40 -0700 (PDT) From: Nghia Le To: mike.kravetz@oracle.com, akpm@linux-foundation.org, nathan@kernel.org, ndesaulniers@google.com Cc: Nghia Le , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, lukas.bulwahn@gmail.com, kernel-janitors@vger.kernel.org Subject: [PATCH] mm/hugetlb.c: remove dead store in demote_size_show() Date: Sun, 3 Oct 2021 18:41:13 +0700 Message-Id: <20211003114113.109463-1-nghialm78@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C8BE5B000D55 X-Stat-Signature: bh5k6ugugqbmjdw8s7z9pgz86ke5ekgf Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="l3/+qZ+l"; spf=pass (imf24.hostedemail.com: domain of nghialm78@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=nghialm78@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1633261301-920753 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: The command "make clang-analyzer" detected a dead store. Remove demote_size and corresponding assignment in function demote_size_show() to fix dead store, as demote_size is never read. Signed-off-by: Nghia Le --- mm/hugetlb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 993efa70bce4..ef00e6ad0f6a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3706,11 +3706,9 @@ static ssize_t demote_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { struct hstate *h; - unsigned long demote_size; int nid; h = kobj_to_hstate(kobj, &nid); - demote_size = h->demote_order; return sysfs_emit(buf, "%lukB\n", (unsigned long)(PAGE_SIZE << h->demote_order) / SZ_1K);