From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EEB12DFF19 for ; Wed, 28 Jan 2026 11:46:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769600816; cv=none; b=ZGpEypxYQlk5/8egkHo2pl1dWzgmppVA3A55gWb+2TS8BQfVPDhS3QPdZvbq5p5nTzxu7itdv4hhRTPEK41mEO1FfEJ3KzBJ++LcnY0Mu9UQQjXkAjbgNrBfrpe3ZBa4lZ8gp81cRKCK1u9A/BYZi2JYWI+QvGsS2/D3ieo4BMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769600816; c=relaxed/simple; bh=/1B77Aa5R+WBSByqnqrIhirli+RecJNNuUsY+wsM0nE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YgJaM0XSC2JTFzQHsZ0q6BU0vQt6jd+c1Wh2TlVg5JkUu2WjM4cbEgzRFG+v13EawhjxOlef/LGBUIVhRSpcyNd+BHT47GQhU04rAYkrsB8+yX0EsB4t/Z3/mdvOpCFwdlT7z+F7z4Tsu0PEPBEj1x1zfX6Y8uAy36GMpBAeFlQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xfGzbHSg; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xfGzbHSg" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-47edd9024b1so56301265e9.3 for ; Wed, 28 Jan 2026 03:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769600813; x=1770205613; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=khJXybkcVVzB8mqgpRU1gLtvPugBIJAWbxW5cUcew3s=; b=xfGzbHSgobyP0+LMy0dj5oQO/eBvJciDqkXOzebpRDkuHTTlIGPZuD7NJtJUDGwr8t pp//Bp7PAEbArRR/xHzTPkxRNLhE28bwGfGddUlncWKFDbSR9froM+pRiDF3TW7coMga REAxRlYp0m8uBEI50SdVBr8gilCHN0GgIJQ0BA7ypNRmjbX3z5PGDVHro11ve33QhOqU qEQwg8Ve45T+UKdPZ/dK6uOcRrtQPDhus9T0uff88RJIJ9VqfadyBlnTnqW+bVw5+vFo kNro7WQ7FJss5/CunVnP7Q4GE0EZ4ANCa8sSGvfPGE18ZT+7cJEeQpZEpo/G1fjHlu46 1FdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769600813; x=1770205613; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=khJXybkcVVzB8mqgpRU1gLtvPugBIJAWbxW5cUcew3s=; b=S/KZt+uso65x1G7O4zIef1GW0BLSjRqJjJPEhvTpsNUkicFeD0HUfM00r7x67+9/cp wAcNEh4XS2jOwkQrXMOo0hLPYfyGv0+8J3jYP4LrCBNRRsRkl3ZvFdVk0TBfmqNRhE37 BnCe3nPWb0SljxJewAPhy2v6XPJ0ViutPhxwQDY6i249+4YuaWdjsqLMR7+VwFk6Q/IZ HsnqQWLgOsSGCItph+wWYu3j9o522EDDqhB2PWHPQAwZb+bhG2VSK56NAsuPJZ9pkdgI 0jzzAyvrhmPDc1cfOIl0TtdMkrunTHuGfDzCRkW1wNN7xJsJw5nPSZdhHx56gcqjFMRo Axsw== X-Forwarded-Encrypted: i=1; AJvYcCWezcBunvBF6Qjc7lIB7vdwTggYRCkuIyMX6UULCcCnSHcVkmlt8P1/bcl60g87kVkR6mBXsOR9RRv+IrA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8iteiy4NBLuoA1Hxm+6auPVsUz+1Za4UwIk4ZPxzWHNt0yd7P XRSsnVIf+MtO3X+F5SG43C16iNoHAQbIScf/SR56BjC1ECWy4JNELtf63xVcbhOrZZo= X-Gm-Gg: AZuq6aKnC+AitGlzyApNP9NszjG7W3JGz6xoaFewobmgDCFoEio54P5qTnjJ8jPVJws LnkE+lzXR5kx30B2NVQPyLQJJLFghFCyzekjMD52gy6xiIu7Puyubq6K3qew0IafyuhP0fu54iy Q5t82mug4yDH9+yEaK93voYoaP41M2MIWAkidyvz4ZOCWJKCWRaoRTY6B5uFoPddnWJKiIzKIRk saZeE3rv+GYHpdC332qjbqXcZ46cWRAXp7LC8pjSUi9enzeiPKMTkaE09TVppH605J0JCDjuHET 6Eg7pTUJG1TGzxrhtqM+Sjd7jUTH4voKbkfNIpgTCkRr/deQoQDCs3X7EDtdJAngFzIqMkckoKN oL20cfUXLpveNELS8UdEBQ5/iHHO5ucrpdwkRcoIPoBZFSFiSDHJnOF6vu28rtW2jQjbKvVumrB 0m8is+Cy+8N8Jb7QmI X-Received: by 2002:a05:600c:a08c:b0:477:63db:c718 with SMTP id 5b1f17b1804b1-48069c43e80mr67128725e9.16.1769600813044; Wed, 28 Jan 2026 03:46:53 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e1354205sm6549747f8f.41.2026.01.28.03.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 03:46:52 -0800 (PST) Date: Wed, 28 Jan 2026 14:46:48 +0300 From: Dan Carpenter To: Madhumitha Sundar Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: sm750fb: replace magic number with defined constant Message-ID: References: <20260127132758.49650-1-madhuananda18@gmail.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=us-ascii Content-Disposition: inline In-Reply-To: <20260127132758.49650-1-madhuananda18@gmail.com> On Tue, Jan 27, 2026 at 01:27:58PM +0000, Madhumitha Sundar wrote: > The hardware wait loop in hw_sm750_de_wait uses a hardcoded magic > number (0x10000000) for the timeout counter. > > Define a constant SM750_MAX_LOOP in sm750.h and use it to improve > code readability and maintainability. Timeout counters have no special meaning. They aren't intended to be re-used in multiple places. There is a kind of bug where people think we exit with the counter set to zero but actually we exit with it set the -1. Normally, when I see this sort of bug, I change the timer from cnt-- to --cnt which changes loop from iterating 100 times to iterating 99 times. It's fine. No one cares if about the exact number, just the approximate range. The original was more clear. regards, dan carpenter