From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 3CBEE2D4811 for ; Tue, 9 Dec 2025 15:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765294859; cv=none; b=qEIWXZBu3wxvZzklHbTH+sPrEKHzRT5ul2cMe6aunlVYi9ZBIf2K0medwfyZfYLGnDTPx4bsbj+w5HKvhlHpB1pNQIifiaiBfYYHiHF4HnqT4l1cpZAXPSLu0boYujJrd0JBPY+owQnFqmj8CTReuo0+uhBa3abE0/Vx9nu26Qw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765294859; c=relaxed/simple; bh=vZOEe0lpdwzHOkJbzFJ5mFazqXBFMJLco4rWA9bw+R4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gHzk0yHkFgvs0E+6T94ep/4JJuPGyvdjm2HY4SVlE8Tx7kBmsLtUGavtXFTWbGt3SbGXJ8thSIu33anDmNHIcN1OJw1yl++jhIZI5pnqFBszBfo7ywzhJZTqZ6MJ6y/UfUdLikJIDH60Az+F8a2Z3m2tIkXR/U6isbkHw2GBOq8= 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=g0GEByGR; arc=none smtp.client-ip=198.175.65.14 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="g0GEByGR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765294858; x=1796830858; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=vZOEe0lpdwzHOkJbzFJ5mFazqXBFMJLco4rWA9bw+R4=; b=g0GEByGRGRLHWZNDiG2ijsdkt5/MkSHEu0I6Q+nFb66Q0GF4oCK3SH8f LjBzzzrarMdkRwtU2wIqLCQZH1ezze5QADOfctPjIkVqiFZUig4l8mQCk CBn5Nsycm24pX4cjEkL4VHJiXynb+nQeo0RQXdAt27RiKy2i9fBdC1p3B VdiF7wNVZMkau5mUpoNpA5Jw81JdzlERfXLuqZNvcx6+QJK6oHnysTHJg WxJpxMgPQP89obCbR5jDL6rmPeGN49UX3wxKuBx6lVI4badEzA3+1juUs uLCMe1DxRFGH4ea6SfOi4QoC8oFbq/uJPNQ0wRMJ8O11xu2Ms1UNWEOxh g==; X-CSE-ConnectionGUID: cngBG0NGRvm7MpZv5lJzpg== X-CSE-MsgGUID: cuVwSlBlRQGi8PXILu8yVw== X-IronPort-AV: E=McAfee;i="6800,10657,11637"; a="71114425" X-IronPort-AV: E=Sophos;i="6.20,261,1758610800"; d="scan'208";a="71114425" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2025 07:40:57 -0800 X-CSE-ConnectionGUID: hZw3R38rQzmjZ+xNBqPlsA== X-CSE-MsgGUID: TxybCfErRsO0sYUDQy8pOg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,261,1758610800"; d="scan'208";a="195857573" Received: from dhhellew-desk2.ger.corp.intel.com (HELO localhost) ([10.245.245.237]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2025 07:40:56 -0800 Date: Tue, 9 Dec 2025 17:40:54 +0200 From: Andy Shevchenko To: Christian Marangi Cc: Ilpo =?iso-8859-1?Q?J=E4rvinen?= , 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> <69383bc9.050a0220.3cbaa0.7757@mx.google.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: <69383bc9.050a0220.3cbaa0.7757@mx.google.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 04:09:57PM +0100, Christian Marangi wrote: > On Tue, Dec 09, 2025 at 05:07:09PM +0200, Andy Shevchenko wrote: > > 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. > > > > Will change in v3 I assume minor touch up to wording might be needed so > it's not a problem. Ah, I just commented on v2, yeah, please give at least 24h between versions of the patch. > > > > return res->end - res->start + 1; > > > > } -- With Best Regards, Andy Shevchenko