linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manank Patel <pmanank200502@gmail.com>
To: rafael@kernel.org
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Manank Patel <pmanank200502@gmail.com>,
	Sudeep Holla <sudeep.holla@arm.com>
Subject: [PATCH v2] "ACPI: PCC: Fix unintentional integer overflow"
Date: Tue, 18 Oct 2022 00:13:39 +0530	[thread overview]
Message-ID: <20221017184338.64152-1-pmanank200502@gmail.com> (raw)
In-Reply-To: <20221017182035.3g67uudttl6k5gag@bogus>

Fixed unintentional u32 overflow by changing PCC_CMD_WAIT_RETRIES_NUM to 500ULL

Fixes: 91cefefb6991 ("ACPI: PCC: replace wait_for_completion()")

Signed-off-by: Manank Patel <pmanank200502@gmail.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>

---
Thank you so much @sudeep for your clarifications!

Changelog:
v1->v2:
        Change the macro itself to ULL instead of typecasting in the
        code

 drivers/acpi/acpi_pcc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
index ee4ce5ba1fb2..3e252be047b8 100644
--- a/drivers/acpi/acpi_pcc.c
+++ b/drivers/acpi/acpi_pcc.c
@@ -27,7 +27,7 @@
  * Arbitrary retries in case the remote processor is slow to respond
  * to PCC commands
  */
-#define PCC_CMD_WAIT_RETRIES_NUM	500
+#define PCC_CMD_WAIT_RETRIES_NUM	500ULL
 
 struct pcc_data {
 	struct pcc_mbox_chan *pcc_chan;
-- 
2.38.0


  reply	other threads:[~2022-10-17 18:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  5:49 [PATCH] ACPI: acpi_pcc.c: Fix unintentional integer overflow pmanank200502
2022-10-13 11:42 ` Rafael J. Wysocki
2022-10-13 13:03   ` [PATCH] Fixes: 91cefefb6991 ("ACPI: acpi_pcc.c: fixed unintentional u32 overflow by redefining a constant") Manank Patel
2022-10-17 17:49     ` [PATCH] Fixes: 91cefefb6991 ("ACPI: PCC: replace wait_for_completion()") Manank Patel
2022-10-17 18:20       ` Sudeep Holla
2022-10-17 18:43         ` Manank Patel [this message]
2022-10-18  1:12           ` [PATCH v2] "ACPI: PCC: Fix unintentional integer overflow" lihuisong (C)
2022-10-26 11:34             ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221017184338.64152-1-pmanank200502@gmail.com \
    --to=pmanank200502@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).