Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4281147pxj; Wed, 12 May 2021 01:58:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxefqPgVAzB6ImiCZ5EVOR4uhhSxZPrTESjM0ZSJVdcnNjcW8SQ8NT8ON17KJ+dJQGIAcky X-Received: by 2002:a05:6402:682:: with SMTP id f2mr41694369edy.297.1620809908974; Wed, 12 May 2021 01:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620809908; cv=none; d=google.com; s=arc-20160816; b=GjiFRWhIIEw76E4DocDTWnnZlbdmI4fh6R1qFrI7SDrkW5mTuMCn1vKm3vlHKx/GtE PuqGaGkcVCuw9cdwM7p9u4BcyCLoad35oISsPIhYXskdtLzU9TTQnl7Gyvq7Fll3LQpz mLqKJ+sXVvjjnnfcuaeDQ+G5MwTNl2+cKJkVfuPnw062tWxb/HNgmQwMv1GQbh6ubdlB of9Pq5TVCYAYg+qnx0LlYgVI0UNKWI1LSpZTeKTVhHaJfNAS0lMzZ8y00wV7DQp5R0Kp zUITHgkl1h6/Ekg0QvmLGXbThRnRTRdjCCGFd1OQx+W7BITtC7mOYm/VAiFVyrk8NPqE k+eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=gwOKGGSoO7byN/nPLuSlHI+5SY5Pj09gqk4wWef4oWk=; b=0EJhfDilx//h4zWDAfU0xiWl5E+m1DSkkwd8Fnny9+b0HIcB5099GNh2EKQqYkFqqZ 4BAwCAld0wWSkRynAdyJawMU9DFEScWHtva96eEldHggsMT4uJ78w0wL7FszUu25NpCJ Il0IsTcZU4bWwZZT4wdX8ls20PTSm3c1M1SyHX63LZ2ys1mi7hFIpnroOCv70UuKuHMZ cDNdE6VrrhvhaypUGKqC2pyYkgVk1xZy7lkNGcfzDkluiu+LZpPaSb0//Wkt+mJNOoog WPFQTYH2WJ4/7T4PAsNRFQMmc8BDdvWJ6f+PXcSnIJdQHqPyFO2FgwFmB91RU86gn645 8Jhg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o19si5780934ejx.540.2021.05.12.01.58.05; Wed, 12 May 2021 01:58:28 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230408AbhELI6R (ORCPT + 99 others); Wed, 12 May 2021 04:58:17 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:36007 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbhELI6R (ORCPT ); Wed, 12 May 2021 04:58:17 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0UYdpUu2_1620809826; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UYdpUu2_1620809826) by smtp.aliyun-inc.com(127.0.0.1); Wed, 12 May 2021 16:57:08 +0800 From: Yang Li To: hdegoede@redhat.com Cc: stuart.w.hayes@gmail.com, mgross@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH v2] platform/x86: drop unneeded assignment in host_control_smi() Date: Wed, 12 May 2021 16:57:05 +0800 Message-Id: <1620809825-84105-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Making '==' operation with ESM_STATUS_CMD_UNSUCCESSFUL directly after calling the function inb() is more efficient, so assignment to 'cmd_status' is redundant. Eliminate the following clang_analyzer warning: drivers/platform/x86/dell/dcdbas.c:397:11: warning: Although the value stored to 'cmd_status' is used in the enclosing expression, the value is never actually read from 'cmd_status' No functional change. Reported-by: Abaci Robot Signed-off-by: Yang Li --- Change in v2 --According to Hans's suggestion, store the inb() value into the s8. https://lore.kernel.org/patchwork/patch/1419026/ drivers/platform/x86/dell/dcdbas.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/platform/x86/dell/dcdbas.c b/drivers/platform/x86/dell/dcdbas.c index d513a59..28447c1 100644 --- a/drivers/platform/x86/dell/dcdbas.c +++ b/drivers/platform/x86/dell/dcdbas.c @@ -394,8 +394,7 @@ static int host_control_smi(void) /* wait a few to see if it executed */ num_ticks = TIMEOUT_USEC_SHORT_SEMA_BLOCKING; - while ((cmd_status = inb(PCAT_APM_STATUS_PORT)) - == ESM_STATUS_CMD_UNSUCCESSFUL) { + while ((s8)inb(PCAT_APM_STATUS_PORT) == ESM_STATUS_CMD_UNSUCCESSFUL) { num_ticks--; if (num_ticks == EXPIRED_TIMER) return -ETIME; -- 1.8.3.1