Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4395eb1

Browse files
JoePerchestorvalds
authored andcommitted
rtc: remove use of seq_printf return value
The seq_printf return value, because it's frequently misused, will eventually be converted to void. See: commit 1f33c41 ("seq_file: Rename seq_overflow() to seq_has_overflowed() and make public") Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9f6a240 commit 4395eb1

File tree

4 files changed

+34
-28
lines changed

4 files changed

+34
-28
lines changed

drivers/rtc/rtc-cmos.c

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -459,23 +459,25 @@ static int cmos_procfs(struct device *dev, struct seq_file *seq)
459459
/* NOTE: at least ICH6 reports battery status using a different
460460
* (non-RTC) bit; and SQWE is ignored on many current systems.
461461
*/
462-
return seq_printf(seq,
463-
"periodic_IRQ\t: %s\n"
464-
"update_IRQ\t: %s\n"
465-
"HPET_emulated\t: %s\n"
466-
// "square_wave\t: %s\n"
467-
"BCD\t\t: %s\n"
468-
"DST_enable\t: %s\n"
469-
"periodic_freq\t: %d\n"
470-
"batt_status\t: %s\n",
471-
(rtc_control & RTC_PIE) ? "yes" : "no",
472-
(rtc_control & RTC_UIE) ? "yes" : "no",
473-
is_hpet_enabled() ? "yes" : "no",
474-
// (rtc_control & RTC_SQWE) ? "yes" : "no",
475-
(rtc_control & RTC_DM_BINARY) ? "no" : "yes",
476-
(rtc_control & RTC_DST_EN) ? "yes" : "no",
477-
cmos->rtc->irq_freq,
478-
(valid & RTC_VRT) ? "okay" : "dead");
462+
seq_printf(seq,
463+
"periodic_IRQ\t: %s\n"
464+
"update_IRQ\t: %s\n"
465+
"HPET_emulated\t: %s\n"
466+
// "square_wave\t: %s\n"
467+
"BCD\t\t: %s\n"
468+
"DST_enable\t: %s\n"
469+
"periodic_freq\t: %d\n"
470+
"batt_status\t: %s\n",
471+
(rtc_control & RTC_PIE) ? "yes" : "no",
472+
(rtc_control & RTC_UIE) ? "yes" : "no",
473+
is_hpet_enabled() ? "yes" : "no",
474+
// (rtc_control & RTC_SQWE) ? "yes" : "no",
475+
(rtc_control & RTC_DM_BINARY) ? "no" : "yes",
476+
(rtc_control & RTC_DST_EN) ? "yes" : "no",
477+
cmos->rtc->irq_freq,
478+
(valid & RTC_VRT) ? "okay" : "dead");
479+
480+
return 0;
479481
}
480482

481483
#else

drivers/rtc/rtc-ds1305.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ static int ds1305_proc(struct device *dev, struct seq_file *seq)
434434
}
435435

436436
done:
437-
return seq_printf(seq,
438-
"trickle_charge\t: %s%s\n",
439-
diodes, resistors);
437+
seq_printf(seq, "trickle_charge\t: %s%s\n", diodes, resistors);
438+
439+
return 0;
440440
}
441441

442442
#else

drivers/rtc/rtc-mrst.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,15 @@ static int mrst_procfs(struct device *dev, struct seq_file *seq)
277277
valid = vrtc_cmos_read(RTC_VALID);
278278
spin_unlock_irq(&rtc_lock);
279279

280-
return seq_printf(seq,
281-
"periodic_IRQ\t: %s\n"
282-
"alarm\t\t: %s\n"
283-
"BCD\t\t: no\n"
284-
"periodic_freq\t: daily (not adjustable)\n",
285-
(rtc_control & RTC_PIE) ? "on" : "off",
286-
(rtc_control & RTC_AIE) ? "on" : "off");
280+
seq_printf(seq,
281+
"periodic_IRQ\t: %s\n"
282+
"alarm\t\t: %s\n"
283+
"BCD\t\t: no\n"
284+
"periodic_freq\t: daily (not adjustable)\n",
285+
(rtc_control & RTC_PIE) ? "on" : "off",
286+
(rtc_control & RTC_AIE) ? "on" : "off");
287+
288+
return 0;
287289
}
288290

289291
#else

drivers/rtc/rtc-tegra.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ static int tegra_rtc_proc(struct device *dev, struct seq_file *seq)
261261
if (!dev || !dev->driver)
262262
return 0;
263263

264-
return seq_printf(seq, "name\t\t: %s\n", dev_name(dev));
264+
seq_printf(seq, "name\t\t: %s\n", dev_name(dev));
265+
266+
return 0;
265267
}
266268

267269
static irqreturn_t tegra_rtc_irq_handler(int irq, void *data)

0 commit comments

Comments
 (0)