From nobody Thu Apr 9 15:00:54 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 E08443CF048 for ; Tue, 7 Apr 2026 16:02:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775577761; cv=none; b=m984428dyuVmpI0ugoDKsSvcnXuuMg79TJ2KVGDEnIhDKrffmZfJkFsWLCOYHgnf06wTS5FRqe9t+6TVnegvqnLCzUZuopMIKQlFCMmRCbTR0em+eb5KknhezBcWrGRcvKCRqjtkhgRFnbEScQzLMcsTN5/qzGOBMci5vweMh1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775577761; c=relaxed/simple; bh=v12I4fNHeG9jvYo3wUAhnOp8GtSP5lv3bu1tJwepx+o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l0Qpk4TVRAkdaRQBjlXXWg9JsWvagKpxPAL0ktPV9pCSQLmMCEbIZTWe14dPZrlxGwX36SyyPnOZ2/nwP30GjZfPMUUsNoJN90TQD90gjI4ZIXBCUIje5XRiDf6pSa+8OlB3GT1KDWd1j0gnX1LS0JXAWuGdNp6U7RNwJPbUJgU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iDaWR5+v; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iDaWR5+v" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775577755; x=1807113755; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v12I4fNHeG9jvYo3wUAhnOp8GtSP5lv3bu1tJwepx+o=; b=iDaWR5+vSECnKrSDzAEXqQpjad/ziuke911Ie5XDA4hFnA2JgZRWXTSI vWWq/04P5wYQjX/NE6+z6nDwIHqVIU0CB6WxlRjz2RRb9vI+yUIvXmhrY TI0FPG76riV0v7ahlNzhgzZViUIQS0dMfVbptR3TBpOOcE1kq9lDhMTNp 4FuCmY0xMFriSYrVmQHZijV0lja/9Es+69g4UwtmtPCx5HHsXO0nwMjO2 oHomTGj7QED2rSxmrsbX9uQ9ndrUtJNDclp6d16B1u9pMZSigqDKJlim7 9zcjhPJBguTWe3z2aBVXdrExGgSjqGVC385e1YR2tG/EK6lwpM068IbES A==; X-CSE-ConnectionGUID: Bg9rzDvBRjOjfjsYYVc5sw== X-CSE-MsgGUID: P0Cz4FJBQtWJuh4gSjZttQ== X-IronPort-AV: E=McAfee;i="6800,10657,11752"; a="80432650" X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="80432650" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2026 09:02:18 -0700 X-CSE-ConnectionGUID: OWVnNBT+QpWoGLOU0SsroA== X-CSE-MsgGUID: R9UhNcoCSlOivPNisG032Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="228119037" Received: from rchatre-desk1.jf.intel.com ([10.165.154.99]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2026 09:02:18 -0700 From: Reinette Chatre To: tony.luck@intel.com, james.morse@arm.com, Dave.Martin@arm.com, babu.moger@amd.com, bp@alien8.de, tglx@linutronix.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, ben.horgan@arm.com, fustini@kernel.org, fenghuay@nvidia.com, peternewman@google.com, linux-kernel@vger.kernel.org, patches@lists.linux.dev, reinette.chatre@intel.com Subject: [PATCH v3 03/13] fs/resctrl: Avoid "may be used uninitialized" warning Date: Tue, 7 Apr 2026 09:02:00 -0700 Message-ID: <56fa3b5937ec6fda4eec162393463d8dbfc1abe4.1775576382.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Building resctrl with extra checks ("W=3D12") produces the following warnin= g: .../include/linux/ucopysize.h:22:17: warning: =E2=80=98buf=E2=80=99 may be= used uninitialized [-Wmaybe-uninitialized] 22 | __check_object_size(ptr, n, to_user); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../include/linux/ucopysize.h: In function =E2=80=98pseudo_lock_measure_tr= igger=E2=80=99: .../include/linux/ucopysize.h:10:13: note: by argument 1 of type =E2=80=98= const void *=E2=80=99 to =E2=80=98__check_object_size=E2=80=99 declared here 10 | extern void __check_object_size(const void *ptr, unsigned long n, | ^~~~~~~~~~~~~~~~~~~ .../fs/resctrl/pseudo_lock.c:754:14: note: =E2=80=98buf=E2=80=99 declared = here 754 | char buf[32]; | ^~~ __check_object_size() ensures the provided buffer is within a valid location but does not read from the uninitialized buffer. Even so, initialize the buffer to silence the warning to help resctrl have a cleaner build. Signed-off-by: Reinette Chatre --- fs/resctrl/pseudo_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c index fa3687d69ebd..e1e9134474f4 100644 --- a/fs/resctrl/pseudo_lock.c +++ b/fs/resctrl/pseudo_lock.c @@ -750,8 +750,8 @@ static ssize_t pseudo_lock_measure_trigger(struct file = *file, size_t count, loff_t *ppos) { struct rdtgroup *rdtgrp =3D file->private_data; + char buf[32] =3D {}; size_t buf_size; - char buf[32]; int ret; int sel; =20 --=20 2.50.1