From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 7D6E81E8332 for ; Tue, 9 Dec 2025 15:07:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765292835; cv=none; b=u09vn4xa1sdL8yQjCDMAWHn8rzOQ/L9LtDbkK8ZvPaxPcuhJpNcQuF0vTaDs9iu4aX7mEnb4PGggSLHG1ah0/rqfjtvtpLSsier/F3YA9BDgkCrhgG56KjHDqXQXm8kIkOJk5fb4JdCqR6uIcyjf5sKY9MkSItPNlOKShCVcic0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765292835; c=relaxed/simple; bh=Q5hfz4cwaUj14Qu2dp7hQ6vQcKoU+M8WcEuPN+RD4/E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Vxfof8cMLOtCfUFyTsioALY26J2iXKTP57EN7flpKzQYUIyUULnuG/aS1MLUo2L/Y28Y5AtgHx/GL5ibCqCJAX9PyC336i6SkRKFLX7ntEeckt9ii9EFKW+A94McWTOVG+2eaWlPgCc4TcaZ7jmZeCYc56Kk+95iNrh37k4YJ3c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iYNa6Th3; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iYNa6Th3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765292833; x=1796828833; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=Q5hfz4cwaUj14Qu2dp7hQ6vQcKoU+M8WcEuPN+RD4/E=; b=iYNa6Th3Zeng61wgdvPPVPu+ds1gXTmpdtszABdzT+YcrOmfUr0q/qwx Cy3ZrtVQ3AVOtgS201cBs2AvgZFgRIl9gK58TybPEZ9Hzcl+YIQQUczFk 1ig4QpQraouRiv6hBBv6k59qSdUz0HP5wmoOTOiB+yPXN1UvB+Vd0BpHq vyCpTDkkBZFZIucX1733aIz9PQ/U19xIdsXu8Rt8gqqZ3yPTDCSXkux9p rriLGi5XhTaTFVDmpYnn0V+s2eqZkRkXXWCOyp8WIjRd0z0QytvvSb0o6 M6Bagsjizv2OdvH5ScRTBKKmHsCv72BqYqWyftmhb4britd62/Znv3GNk Q==; X-CSE-ConnectionGUID: c5BBaCAQQUCohE+AOehbCQ== X-CSE-MsgGUID: 6jSdsvgPQT2rTwyvfAXzEw== X-IronPort-AV: E=McAfee;i="6800,10657,11637"; a="84660738" X-IronPort-AV: E=Sophos;i="6.20,261,1758610800"; d="scan'208";a="84660738" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2025 07:07:12 -0800 X-CSE-ConnectionGUID: P3iRyFu2TpSt0RT1GN6B1g== X-CSE-MsgGUID: StQyXD+KRxSUKCaE7S5AsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,261,1758610800"; d="scan'208";a="196697171" Received: from dhhellew-desk2.ger.corp.intel.com (HELO localhost) ([10.245.245.237]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2025 07:07:12 -0800 Date: Tue, 9 Dec 2025 17:07:09 +0200 From: Andy Shevchenko To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: Christian Marangi , Andrew Morton , LKML Subject: Re: [PATCH] resource: add WARN_ON_ONCE for resource_size() and document misusage Message-ID: References: <20251208202921.16819-1-ansuelsmth@gmail.com> <2c80f567-d632-b37e-c419-db059b1f2771@linux.intel.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2c80f567-d632-b37e-c419-db059b1f2771@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Tue, Dec 09, 2025 at 12:25:38PM +0200, Ilpo Järvinen wrote: > On Mon, 8 Dec 2025, Christian Marangi wrote: ... > > static inline resource_size_t resource_size(const struct resource *res) > > { > > + WARN_ON_ONCE(!res->flags); > > As lkp also found out, you need to add #include Since it's header, we may use better one from asm, i.e. asm/bug.h. This will give finer granularity and less possible tangled dependencies in the future. > > return res->end - res->start + 1; > > } -- With Best Regards, Andy Shevchenko