public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joshua Kinard <kumba@gentoo.org>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] rtc: Use str_enable_disable-like helpers
Date: Wed, 15 Jan 2025 17:56:29 +0100	[thread overview]
Message-ID: <8976e64c-34aa-47ca-9d5c-81cb06392621@linaro.org> (raw)
In-Reply-To: <20250115162923ddf1d821@mail.local>

On 15/01/2025 17:29, Alexandre Belloni wrote:
>>  /*
>> @@ -252,7 +253,7 @@ static int at91_rtc_proc(struct device *dev, struct seq_file *seq)
>>  	u32 mr = rtt_readl(rtc, MR);
>>  
>>  	seq_printf(seq, "update_IRQ\t: %s\n",
>> -		   (mr & AT91_RTT_RTTINCIEN) ? "yes" : "no");
>> +		   str_yes_no(mr & AT91_RTT_RTTINCIEN));
>>  	return 0;
>>  }
>>  
>> diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
>> index 78f2ce12c75a..1f556cdd778f 100644
>> --- a/drivers/rtc/rtc-cmos.c
>> +++ b/drivers/rtc/rtc-cmos.c
>> @@ -32,6 +32,7 @@
>>  #include <linux/init.h>
>>  #include <linux/interrupt.h>
>>  #include <linux/spinlock.h>
>> +#include <linux/string_choices.h>
>>  #include <linux/platform_device.h>
>>  #include <linux/log2.h>
>>  #include <linux/pm.h>
>> @@ -604,12 +605,12 @@ static int cmos_procfs(struct device *dev, struct seq_file *seq)
>>  		   "DST_enable\t: %s\n"
>>  		   "periodic_freq\t: %d\n"
>>  		   "batt_status\t: %s\n",
>> -		   (rtc_control & RTC_PIE) ? "yes" : "no",
>> -		   (rtc_control & RTC_UIE) ? "yes" : "no",
>> -		   use_hpet_alarm() ? "yes" : "no",
>> +		   str_yes_no(rtc_control & RTC_PIE),
>> +		   str_yes_no(rtc_control & RTC_UIE),
>> +		   str_yes_no(use_hpet_alarm()),
>>  		   // (rtc_control & RTC_SQWE) ? "yes" : "no",
>>  		   (rtc_control & RTC_DM_BINARY) ? "no" : "yes",
> 
> I guess you missed those two.


Yeah, indeed.

> However, I'm in favor of ripping the whole procfs out of the kernel
> 
I can send changing these two or skipping procfs parts entirely.

Best regards,
Krzysztof


      reply	other threads:[~2025-01-15 16:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 20:36 [PATCH] rtc: Use str_enable_disable-like helpers Krzysztof Kozlowski
2025-01-15 16:29 ` Alexandre Belloni
2025-01-15 16:56   ` Krzysztof Kozlowski [this message]

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=8976e64c-34aa-47ca-9d5c-81cb06392621@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=kumba@gentoo.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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