Message ID | a11b0c78-4717-4f4e-90be-f47f300d607c@moroto.mountain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp562802vqx; Mon, 3 Jul 2023 07:25:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEzHtw52YK7VQKGeV6tgpHGLAAuFzUrCMjhzYAjgdc2xF9SdkO4lOYVsf6a3GfsOBdJ8nWb X-Received: by 2002:a92:760d:0:b0:33b:d741:5888 with SMTP id r13-20020a92760d000000b0033bd7415888mr10124825ilc.0.1688394311373; Mon, 03 Jul 2023 07:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688394311; cv=none; d=google.com; s=arc-20160816; b=w3oOFbGWADKvul+AdnUEc+SGzquQOVWafF7TkXpA46h2j5d0htnFhKjHpffDB5WKpj OMcQaru1vcfaJAx75mYgm/uvcbpZs9PkARdxNWeX9TQ39wIpiE5gmL8Ind6aQQrjBMMv fE9vyt/tljmJb/z+14X23mSC2Yd2UrsIHWlRjbYVGcGxcbuOz/E4U4bit/GRqIO+uN0T uVf+CNPGKd3oKyl5yHp+n8af9AY0VapWByaWgM5kuWFHPXTJ1WbyzYNTrw6Fkq3eXwWN +NTGJ8ca2u+pDASLCyceVKMgdGgKt8Ry6UnRgVwh0ag5KPbMWhEErEsDcI5L8OEQRnFn i8VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=UTlCyTZXo+b+onVAuuCqLFFIg0VR0QnZHvj+HALD0/4=; fh=KaHnxzmS3OBP4FAANqWqrGWt85R+5vfn3IkOYMZ+WUE=; b=mTwgxc2EUhM7S6TsmP7HroYhyzrf5F7dkx0vD/5yML8Ei3THONbcfMcoKdfzPdV8y7 3XLHXfwif4PndIscXTp04vAAZhKriIPGnRMQrlxogy4p7c/xsR89zsruXR3naZvNigj4 zmyqRYSSAQjYXvfTrcdw8BNb6k5+cHRRSaRuYnBPIcO9Srhd3D+pklie4DpasTXLmsy+ OuaII6h5pGvn0tq52QZvR26U3hl6gkxzTfL6rG8ZC+xE7AHya8jtWmbDVJPMLvEB29zW /stEL97Tuo0lZDlg/48YVk9L5qo1kuoLGjrlRkO+10+kr6OoY15zaegL7kHARBW/qqgQ rzhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="reQ/K488"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a654389000000b0055b5f13dd5csi7508324pgp.451.2023.07.03.07.24.58; Mon, 03 Jul 2023 07:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="reQ/K488"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230391AbjGCORy (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Mon, 3 Jul 2023 10:17:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjGCORx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Jul 2023 10:17:53 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3117AE5E for <linux-kernel@vger.kernel.org>; Mon, 3 Jul 2023 07:17:52 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-307d20548adso5004923f8f.0 for <linux-kernel@vger.kernel.org>; Mon, 03 Jul 2023 07:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688393870; x=1690985870; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=UTlCyTZXo+b+onVAuuCqLFFIg0VR0QnZHvj+HALD0/4=; b=reQ/K4887bs6S4mnAfRPRNQkwgE+H+XF5H7ZAQ4m/dHTk/PBuGZmGaCV/O9LdUDA3C 5MzWr4MJReXvaX/YFEH0k3fIgPFWMZJElrp7V0PHgWmH9bBg0juG6G7sD1JX4ef0UqCI wfH1jTCaz+HikHasy3P4pxiaLwW+V6PR5MHaaQfZGCODlDDH/ttRR+F7gCyiUfR03mCv byznfdUuMvYNXZ+bbKAV/tKahux7a/tyktjuvCTr56K9/jDD0dlSkLiljVXbY6siQlso t/50lycpzANpGuhLlUyWw0LovAFTidAwflC+pE1/BfOruSBZR8uhbnvN6Mzjgiga+RpI 2rcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688393870; x=1690985870; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UTlCyTZXo+b+onVAuuCqLFFIg0VR0QnZHvj+HALD0/4=; b=OcZB0XhFukbv06/rYwzkLakCFiyVK28Yo/y29lxDH7Tv51Yqo2IfMCLrtslaUCBG3X pE1kAbVMY8+sz4xRAcbLEsIIy2enh+zuzFhB8eVzrOgLrHjJ+LeFJ7nSScyv5/wLp5Fq ZaHi9O3+xfSciZ6wpb3eDpcPhNqz+jvsG3Hv0j307Nh/4MEyYdjvTCVPLwNXpMVeXyaN Pz7tqd48Lj5A0s4ZB4PavLD39z2TojxpUBor0SCOEt+ttkeumICXIutpgALH0l4iBvxH nqNnHkIgixoGkyjpy0cbukeOAC9uAk54IyQ6rqbK2UtVcVPRXSvfHnsCK9XZ+CKzRA3I 6k5A== X-Gm-Message-State: ABy/qLYZf9qp+qzPQUPItKBGx0Tx9i1rW4RClPIO0/CmsZmnjQghVN9H FeBxZiyODpMiZjMnklVw+PMy0A== X-Received: by 2002:adf:f504:0:b0:30f:be04:5b5e with SMTP id q4-20020adff504000000b0030fbe045b5emr7875625wro.37.1688393870728; Mon, 03 Jul 2023 07:17:50 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id u2-20020adfdd42000000b00314326c91e2sm4465022wrm.28.2023.07.03.07.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 07:17:49 -0700 (PDT) Date: Mon, 3 Jul 2023 17:17:45 +0300 From: Dan Carpenter <dan.carpenter@linaro.org> To: Vishal Verma <vishal.l.verma@intel.com> Cc: Alison Schofield <alison.schofield@intel.com>, Ira Weiny <ira.weiny@intel.com>, Ben Widawsky <bwidawsk@kernel.org>, Dan Williams <dan.j.williams@intel.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Dave Jiang <dave.jiang@intel.com>, linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] cxl/mem: Fix a double shift bug Message-ID: <a11b0c78-4717-4f4e-90be-f47f300d607c@moroto.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770409753706530842?= X-GMAIL-MSGID: =?utf-8?q?1770409753706530842?= |
Series |
cxl/mem: Fix a double shift bug
|
|
Commit Message
Dan Carpenter
July 3, 2023, 2:17 p.m. UTC
The CXL_FW_CANCEL macro is used with set/test_bit() so it should be a
bit number and not the shifted value. The original code is the
equivalent of using BIT(BIT(0)) so it's 0x2 instead of 0x1. This has
no effect on runtime because it's done consistently and nothing else
was using the 0x2 bit.
Fixes: 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/cxl/cxlmem.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 7/3/23 07:17, Dan Carpenter wrote: > The CXL_FW_CANCEL macro is used with set/test_bit() so it should be a > bit number and not the shifted value. The original code is the > equivalent of using BIT(BIT(0)) so it's 0x2 instead of 0x1. This has > no effect on runtime because it's done consistently and nothing else > was using the 0x2 bit. > > Fixes: 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Dave Jiang <dave.jiang@intel.com> > --- > drivers/cxl/cxlmem.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > index 79e99c873ca2..499113328586 100644 > --- a/drivers/cxl/cxlmem.h > +++ b/drivers/cxl/cxlmem.h > @@ -323,7 +323,7 @@ struct cxl_mbox_activate_fw { > > /* FW state bits */ > #define CXL_FW_STATE_BITS 32 > -#define CXL_FW_CANCEL BIT(0) > +#define CXL_FW_CANCEL 0 > > /** > * struct cxl_fw_state - Firmware upload / activation state
On Mon, 03 Jul 2023, Dan Carpenter wrote: >The CXL_FW_CANCEL macro is used with set/test_bit() so it should be a >bit number and not the shifted value. The original code is the >equivalent of using BIT(BIT(0)) so it's 0x2 instead of 0x1. This has >no effect on runtime because it's done consistently and nothing else >was using the 0x2 bit. > >Fixes: 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader") >Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
On Mon, 2023-07-03 at 17:17 +0300, Dan Carpenter wrote: > The CXL_FW_CANCEL macro is used with set/test_bit() so it should be a > bit number and not the shifted value. The original code is the > equivalent of using BIT(BIT(0)) so it's 0x2 instead of 0x1. This has > no effect on runtime because it's done consistently and nothing else > was using the 0x2 bit. > > Fixes: 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Vishal Verma <vishal.l.verma@intel.com> > --- > drivers/cxl/cxlmem.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > index 79e99c873ca2..499113328586 100644 > --- a/drivers/cxl/cxlmem.h > +++ b/drivers/cxl/cxlmem.h > @@ -323,7 +323,7 @@ struct cxl_mbox_activate_fw { > > /* FW state bits */ > #define CXL_FW_STATE_BITS 32 > -#define CXL_FW_CANCEL BIT(0) > +#define CXL_FW_CANCEL 0 > > /** > * struct cxl_fw_state - Firmware upload / activation state
diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h index 79e99c873ca2..499113328586 100644 --- a/drivers/cxl/cxlmem.h +++ b/drivers/cxl/cxlmem.h @@ -323,7 +323,7 @@ struct cxl_mbox_activate_fw { /* FW state bits */ #define CXL_FW_STATE_BITS 32 -#define CXL_FW_CANCEL BIT(0) +#define CXL_FW_CANCEL 0 /** * struct cxl_fw_state - Firmware upload / activation state