mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joshua Kinard <linux@kumba.dev>
To: alexandre.belloni@bootlin.com
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 09/12] rtc: ds1685: use sysfs_emit() instead of sprintf()
Date: Thu, 29 Oct 2026 09:49:18 -0400	[thread overview]
Message-ID: <cd2a54f7-89f2-4683-b6da-cf14e62fffe0@kumba.dev> (raw)
In-Reply-To: <20261029132339.925021-9-alexandre.belloni@bootlin.com>

On 10/29/2026 09:23, alexandre.belloni@bootlin.com wrote:
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> 
> Use sysfs_emit() instead of sprintf() in sysfs show callbacks
> (ds1685_rtc_sysfs_battery_show, ds1685_rtc_sysfs_auxbatt_show and
> ds1685_rtc_sysfs_serial_show) to conform to the recommended sysfs
> attribute formatting guidelines in
> Documentation/filesystems/sysfs.rst.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>   drivers/rtc/rtc-ds1685.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> index 284815e5f478..323fc9c17106 100644
> --- a/drivers/rtc/rtc-ds1685.c
> +++ b/drivers/rtc/rtc-ds1685.c
> @@ -988,8 +988,8 @@ ds1685_rtc_sysfs_battery_show(struct device *dev,
>   
>   	ctrld = rtc->read(rtc, RTC_CTRL_D);
>   
> -	return sprintf(buf, "%s\n",
> -			(ctrld & RTC_CTRL_D_VRT) ? "ok" : "not ok or N/A");
> +	return sysfs_emit(buf, "%s\n",
> +			  (ctrld & RTC_CTRL_D_VRT) ? "ok" : "not ok or N/A");
>   }
>   static DEVICE_ATTR(battery, S_IRUGO, ds1685_rtc_sysfs_battery_show, NULL);
>   
> @@ -1010,8 +1010,8 @@ ds1685_rtc_sysfs_auxbatt_show(struct device *dev,
>   	ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
>   	ds1685_rtc_switch_to_bank0(rtc);
>   
> -	return sprintf(buf, "%s\n",
> -			(ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
> +	return sysfs_emit(buf, "%s\n",
> +			  (ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
>   }
>   static DEVICE_ATTR(auxbatt, S_IRUGO, ds1685_rtc_sysfs_auxbatt_show, NULL);
>   
> @@ -1032,7 +1032,7 @@ ds1685_rtc_sysfs_serial_show(struct device *dev,
>   	ds1685_rtc_get_ssn(rtc, ssn);
>   	ds1685_rtc_switch_to_bank0(rtc);
>   
> -	return sprintf(buf, "%8phC\n", ssn);
> +	return sysfs_emit(buf, "%8phC\n", ssn);
>   }
>   static DEVICE_ATTR(serial, S_IRUGO, ds1685_rtc_sysfs_serial_show, NULL);
>   

Acked-by: Joshua Kinard <linux@kumba.dev>

  reply	other threads:[~2026-10-29 13:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 02/12] rtc: pcf2127: " alexandre.belloni
2026-10-29 18:20   ` Bruno Thomsen
2026-10-29 13:23 ` [PATCH 03/12] rtc: ep93xx: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 04/12] rtc: bq32k: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 05/12] rtc: x1205: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 06/12] rtc: abx80x: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 07/12] rtc: rx8025: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 08/12] rtc: ds1343: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 09/12] rtc: ds1685: " alexandre.belloni
2026-10-29 13:49   ` Joshua Kinard [this message]
2026-10-29 13:23 ` [PATCH 10/12] rtc: isl1208: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 11/12] rtc: ds1307: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 12/12] rtc: rs5c372: " alexandre.belloni

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=cd2a54f7-89f2-4683-b6da-cf14e62fffe0@kumba.dev \
    --to=linux@kumba.dev \
    --cc=alexandre.belloni@bootlin.com \
    --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

all inboxes | Powered by JetHome®