From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B78B477995; Tue, 16 Jun 2026 16:56:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781629003; cv=none; b=uxRCiZ/GwFTwCDdO3yew3MFdszW9oksuo4jHC5Z1QzIQeRuxRgb2YOZvw4YtK7TRWdtemRH1+ESLZuxosJw3ZPGnmZuhjptGMtUj+ESwtwtg7rGhxlRlr18Ahpau6zWzfXs3HsDk4WKaxFwKHnU33ebUUtSvdl8AC4fZeakPQNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781629003; c=relaxed/simple; bh=L1UvTBCMcvDc0umpkddgoznzTxGscCUUH9ThMdXwJEA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eIi7evUwW9KjBIYt+V+1N6UXg6KCfCvLW1h4DsPBMwy8p6G2GQQUdHKsF0vYBzBD013lg0KQEKhyBb6eP0K/0a+op1CBft5MsCoO1bYtvYKyQlpJh29YdPIcuLft8V5ei6+2UR5eOU4AurIvmLOECN4YtW/zD9cmCzwEcthJkYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hCGLzfP+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hCGLzfP+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CBAE1F00A3A; Tue, 16 Jun 2026 16:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781629001; bh=jqe7mx+nV3JS4lDjiSsGsfxNPqGwo6x4lcf68Cme21I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hCGLzfP+e1PmdA/dBv9Ibj08MnfiGkh0UhAIo03sDzwUYdwF7qtm40Yc5NfE0F7UP C5h5fEyuQjxEHsHWnj3y2aAfPs81NYRwmeQXuPLlWAoBycsWRRvf4T2/d1tzORp0oj n6pmmOazZTpf4g28v3sWhjSGFapBuFREyHmw/luc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miguel Ojeda , Nathan Chancellor , Linus Torvalds , Lee Jones Subject: [PATCH 6.6 202/452] HID: core: Fix size_t specifier in hid_report_raw_event() Date: Tue, 16 Jun 2026 20:27:09 +0530 Message-ID: <20260616145128.428400451@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145117.796205997@linuxfoundation.org> References: <20260616145117.796205997@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nathan Chancellor commit 4d3a2a466b8d68d852a1f3bbf11204b718428dc4 upstream. When building for 32-bit platforms, for which 'size_t' is 'unsigned int', there are warnings around using the incorrect format specifier to print bsize in hid_report_raw_event(): drivers/hid/hid-core.c:2054:29: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] 2053 | hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %ld)\n", | ~~~ | %zu 2054 | report->id, csize, bsize); | ^~~~~ drivers/hid/hid-core.c:2076:29: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] 2075 | hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %ld)\n", | ~~~ | %zu 2076 | report->id, rsize, bsize); | ^~~~~ Use the proper 'size_t' format specifier, '%zu', to clear up the warnings. Cc: stable@vger.kernel.org Fixes: 2c85c61d1332 ("HID: pass the buffer size to hid_report_raw_event") Reported-by: Miguel Ojeda Closes: https://lore.kernel.org/20260516020430.110135-1-ojeda@kernel.org/ Signed-off-by: Nathan Chancellor Signed-off-by: Linus Torvalds Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2003,7 +2003,7 @@ int hid_report_raw_event(struct hid_devi return 0; if (unlikely(bsize < csize)) { - hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %ld)\n", + hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %zu)\n", report->id, csize, bsize); return -EINVAL; } @@ -2025,7 +2025,7 @@ int hid_report_raw_event(struct hid_devi rsize = max_buffer_size; if (bsize < rsize) { - hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %ld)\n", + hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %zu)\n", report->id, rsize, bsize); return -EINVAL; }