public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Meagan Lloyd <meaganlloyd@linux.microsoft.com>
To: Ronan Dalton <Ronan.Dalton@alliedtelesis.co.nz>
Cc: "meaganlloyd@linux.microsoft.com"
	<meaganlloyd@linux.microsoft.com>,
	"tgopinath@linux.microsoft.com" <tgopinath@linux.microsoft.com>,
	"giometti@enneenne.com" <giometti@enneenne.com>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	Chris Packham <Chris.Packham@alliedtelesis.co.nz>,
	"sashal@kernel.org" <sashal@kernel.org>,
	"code@tyhicks.com" <code@tyhicks.com>
Subject: Re: [PATCH] rtc: ds1307: handle oscillator stop flag for ds1337/ds1339/ds3231
Date: Tue, 5 May 2026 18:41:11 -0700	[thread overview]
Message-ID: <20260505-ec9618931e890b4f0f1b62ab@linux.microsoft.com> (raw)
In-Reply-To: <39365e134ab175492292317ea14bb16172dd580b.camel@alliedtelesis.co.nz>

Hi Ronan,

On Tue, May 05, 2026 at 10:24:55PM +0000, Ronan Dalton wrote:
> Hi Meagan,
> 
> On Tue, 2026-05-05 at 12:20 -0700, Meagan Lloyd wrote:
> > Hi Ronan,
> > 
> > On Mon, May 04, 2026 at 11:54:32PM +0000, Ronan Dalton wrote:
> > > Hi Meagan,
> > > 
> > > On Mon, 2026-05-04 at 15:08 -0700, Meagan Lloyd wrote:
> > > > > +       case ds_1337:
> > > > > +       case ds_1339:
> > > > > +       case ds_1341:
> > > > > +       case ds_3231:
> > > > > +               ret = regmap_read(ds1307->regmap,
> > > > > DS1337_REG_STATUS, &tmp);
> > > > > +               if (ret)
> > > > > +                       return ret;
> > > > > +               if (tmp & DS1337_BIT_OSF)
> > > > > +                       return -EINVAL;
> > > > > +               break;
> > > > 
> > > > If you're going to re-arrange the block to be in somewhat of an
> > > > order,
> > > > perhaps put it above 1338 since 1337 < 1338.
> > > 
> > > I've ordered it this way based on the first case statement in each
> > > block. Since ds_1337 > ds_1308, I've put the block below the block
> > > starting with ds_1308. I could instead order it based on the last
> > > case
> > > statement in each block, if you think that's better.
> > 
> > I agree with your ordering strategy, but your patch inserts it after
> > the
> > ds_1338 case statement block (rather than the intended ds_1308).
> > 
> 
> Here's how it currently is in ds1307_get_time:
> 
> 	case ds_1308:
> 	case ds_1338:
> 		[statement block #1]
> 	case ds_1337:
> 	case ds_1339:
> 	case ds_1341:
> 	case ds_3231:
> 		[statement block #2]
> 
> To insert statement block #2 after the ds_1308 case label would involve
> the following:
> 
> 	case ds_1308:
> 		[statement block #1]
> 	case ds_1337:
> 	case ds_1339:
> 	case ds_1341:
> 	case ds_3231:
> 		[statement block #2]
> 	case ds_1338:
> 		[statement block #1, duplicated]
> 
> Or the following with strict order:
> 
> 	case ds_1308:
> 		[statement block #1]
> 	case ds_1337:
> 		[statement block #2]
> 	case ds_1338:
> 		[statement block #1, duplicated]
> 	case ds_1339:
> 	case ds_1341:
> 	case ds_3231:
> 		[statement block #2, duplicated]
> 
> The case statements can be put strictly in order, but that will involve
> some duplication.

You are absolutely right. I missed that ds_1308 and ds_1338 share a
statement block. No need to change anything, thanks for the clear
explanation!

Reviewed-by: Meagan Lloyd <meaganlloyd@linux.microsoft.com>

  reply	other threads:[~2026-05-06  1:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01  4:46 [PATCH] rtc: ds1307: handle oscillator stop flag for ds1337/ds1339/ds3231 Ronan Dalton
2026-05-01  5:14 ` Chris Packham
2026-05-04 22:08 ` Meagan Lloyd
2026-05-04 23:54   ` Ronan Dalton
2026-05-05 19:20     ` Meagan Lloyd
2026-05-05 22:24       ` Ronan Dalton
2026-05-06  1:41         ` Meagan Lloyd [this message]
2026-05-06  1:57           ` Ronan Dalton

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=20260505-ec9618931e890b4f0f1b62ab@linux.microsoft.com \
    --to=meaganlloyd@linux.microsoft.com \
    --cc=Chris.Packham@alliedtelesis.co.nz \
    --cc=Ronan.Dalton@alliedtelesis.co.nz \
    --cc=alexandre.belloni@bootlin.com \
    --cc=code@tyhicks.com \
    --cc=giometti@enneenne.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=tgopinath@linux.microsoft.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