public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Jan Dabros <jsd@semihalf.com>, Andi Shyti <andi.shyti@kernel.org>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: designware: Replace magic numbers with named constants
Date: Thu, 6 Nov 2025 12:52:54 +0200	[thread overview]
Message-ID: <aQx-BlL9PjHeR7Dy@smile.fi.intel.com> (raw)
In-Reply-To: <20251106104228.GP2912318@black.igk.intel.com>

On Thu, Nov 06, 2025 at 11:42:28AM +0100, Mika Westerberg wrote:
> On Wed, Nov 05, 2025 at 07:18:44PM +0300, Artem Shimko wrote:

...

> /* Timeouts in us */
> #define DW_IC_BUSY_POLL_TIMEOUT		1100
> #define DW_IC_BUSY_TOTAL_TIMEOUT	20000
> #define DW_IC_FOO_TIMEOUT		1234

It's in-kernel practice to add units to the definitions and avoid unneeded
comments. Also it will be clearer to the reader without looking back for any
comments like above.

...

> All the register offsets, shifts and masks should be in
> drivers/i2c/busses/i2c-designware-core.h and you don't need to "document"
> them because all this is available in the datasheet.

Also the benefit could be switch to use bitfield.h.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-11-06 10:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 16:18 [PATCH] i2c: designware: Replace magic numbers with named constants Artem Shimko
2025-11-06 10:42 ` Mika Westerberg
2025-11-06 10:52   ` Andy Shevchenko [this message]
2025-11-06 11:09     ` Artem Shimko
2025-12-04 11:41       ` [PATCH v2] " Artem Shimko
2025-12-04 12:00         ` Mika Westerberg
2025-12-04 12:07           ` Artem Shimko
2025-12-04 12:12             ` Mika Westerberg
2025-12-04 14:40               ` Artem Shimko
2025-11-06 11:01   ` [PATCH] " Artem Shimko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQx-BlL9PjHeR7Dy@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andi.shyti@kernel.org \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox