Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3264476pxb; Mon, 18 Oct 2021 11:27:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydgFn2YmhdW5f2a5qJUnl4LuhzzAyOLmukBZ2CQrnB8bU/MweJ+UUyNDIPcpx21xpGqtXE X-Received: by 2002:a17:90a:4306:: with SMTP id q6mr593228pjg.202.1634581672128; Mon, 18 Oct 2021 11:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634581672; cv=none; d=google.com; s=arc-20160816; b=PMFomJYsA+F9HwrvXLDJHu8rkuorNnLfWXgqoTPNoT5jpTu+dJqSPEFzqsNPtT/aOu yydbnjYYdrPd9sJGUQ1FMFkgnZuDWROh7rAzFvyM3Yebuic/fLg4zIyH5Lw8zHJsMm4o rzkqH+qxYIdGCiRAjDeH7Sxl3O2pziAka7ZdV1iMu3o1ku8tBn7XO5iPKXaRNA2iwyGH oCWzF4t4+JXfx5GetJpcQ47RRKPArnIqEUWNKO1w1B7zKL24AIHDxX03Ld5htaaw2+vZ eC2s793p4iIjxRVZ3CqTLXoQBwrPPZ/lzoFtSLqTR8++OPqN2USp+5RnQJsIWO1+lBLu CXKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=X33VqLSJZjLnZ4okYRuzcBplsAc0fZZqcsSK23cn0Lw=; b=zMi+vyVJFiWjkRJIbooi0Jjziwso6iAaIaiznGwXq4r0iCiE4nmWfZBsM+C4MShOJN ODSA94CLb028AllrWeWcBBzL4Q/LlxpiNdQV4gOj/ev3L4NJhW22Dx89t2EzqpgcXeIG wwIFbdZb+7Uw2ICxEWN3tUKLZny1CJeDCEMJkCqv/uk1fk/Xs+CitoLuCcoCD2H/EIaH wJCx0XDkfETIHiProLUgV9P8lfvsc7o2jbSc95UAHa/9tzXEfD5rxkiG8X9dbKM1MXXl XDDrhRJFehQztVfxPJCm8b7zwAe/mv9fr/VC1wyw1KBFEguekDfeqM1fmifPxTGwP+xt ixsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="GRZhZS/H"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x3si1320541plo.430.2021.10.18.11.27.38; Mon, 18 Oct 2021 11:27:52 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="GRZhZS/H"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231970AbhJRS2y (ORCPT + 99 others); Mon, 18 Oct 2021 14:28:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:53574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbhJRS2y (ORCPT ); Mon, 18 Oct 2021 14:28:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF10C60FC3; Mon, 18 Oct 2021 18:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634581602; bh=KI9JuVCbSBSiLAA3FJP117XRg8SfuEvdSqQocdxNHEg=; h=From:To:Cc:Subject:Date:From; b=GRZhZS/Ht1Xb7xubyx+6ai35HscsNCo27FdQ6TTsCyzfSLm2Io5jb0LNeNi6E9eol 1sehiQR5hTq+O8K041bMBurHhTz1ANSDmxB2Rw7AAME7vrg7HSPXXVjVTvzFOq0Z5+ JUCF42ptxyvaXGUd8EGS9ejULiyCyk4qLm4hJS9fKwRXJLxgxhDDd/W0QPfgvjS/tS bXPyhYvzvIZbehErtAvcVLruZjxN70jqb5YKIfZAy7AjuG280OS98Qcm264TvRdCId 1FzoTU7/mHg2QeQcvbcr4zV7TV6pvkT1J2APha/A7DhFZlB7MYPMb0RER5o2iPpiD3 P3yxgSTNiNz0w== From: Nathan Chancellor To: Henrique de Moraes Holschuh , Hans de Goede , Mark Gross Cc: Nick Desaulniers , ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , Tor Vic Subject: [PATCH] platform/x86: thinkpad_acpi: Fix bitwise vs. logical warning Date: Mon, 18 Oct 2021 11:25:37 -0700 Message-Id: <20211018182537.2316800-1-nathan@kernel.org> X-Mailer: git-send-email 2.33.1.637.gf443b226ca MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A new warning in clang points out a use of bitwise OR with boolean expressions in this driver: drivers/platform/x86/thinkpad_acpi.c:9061:11: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] else if ((strlencmp(cmd, "level disengaged") == 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || drivers/platform/x86/thinkpad_acpi.c:9061:11: note: cast one or both operands to int to silence this warning 1 error generated. This should clearly be a logical OR so change it to fix the warning. Fixes: fe98a52ce754 ("ACPI: thinkpad-acpi: add sysfs support to fan subdriver") Link: https://github.com/ClangBuiltLinux/linux/issues/1476 Reported-by: Tor Vic Signed-off-by: Nathan Chancellor --- drivers/platform/x86/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 07b9710d500e..7442c3bb446a 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -9058,7 +9058,7 @@ static int fan_write_cmd_level(const char *cmd, int *rc) if (strlencmp(cmd, "level auto") == 0) level = TP_EC_FAN_AUTO; - else if ((strlencmp(cmd, "level disengaged") == 0) | + else if ((strlencmp(cmd, "level disengaged") == 0) || (strlencmp(cmd, "level full-speed") == 0)) level = TP_EC_FAN_FULLSPEED; else if (sscanf(cmd, "level %d", &level) != 1) base-commit: 85303db36b6e170917a7bc6aae4898c31a5272a0 -- 2.33.1.637.gf443b226ca