Skip to content

Commit 4740158

Browse files
rtc: ds1685: remove set but unused variables
Fix the following warnings: drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_read_time’: drivers/rtc/rtc-ds1685.c:264:5: warning: variable ‘ctrlb’ set but not used [-Wunused-but-set-variable] 264 | u8 ctrlb, century; | ^~~~~ drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_proc’: drivers/rtc/rtc-ds1685.c:758:19: warning: variable ‘ctrlc’ set but not used [-Wunused-but-set-variable] 758 | u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8]; | ^~~~~ Cc: Joshua Kinard <[email protected]> Acked-By: Joshua Kinard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 75859ab commit 4740158

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/rtc/rtc-ds1685.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static int
261261
ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
262262
{
263263
struct ds1685_priv *rtc = dev_get_drvdata(dev);
264-
u8 ctrlb, century;
264+
u8 century;
265265
u8 seconds, minutes, hours, wday, mday, month, years;
266266

267267
/* Fetch the time info from the RTC registers. */
@@ -274,7 +274,6 @@ ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
274274
month = rtc->read(rtc, RTC_MONTH);
275275
years = rtc->read(rtc, RTC_YEAR);
276276
century = rtc->read(rtc, RTC_CENTURY);
277-
ctrlb = rtc->read(rtc, RTC_CTRL_B);
278277
ds1685_rtc_end_data_access(rtc);
279278

280279
/* bcd2bin if needed, perform fixups, and store to rtc_time. */
@@ -755,15 +754,14 @@ static int
755754
ds1685_rtc_proc(struct device *dev, struct seq_file *seq)
756755
{
757756
struct ds1685_priv *rtc = dev_get_drvdata(dev);
758-
u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8];
757+
u8 ctrla, ctrlb, ctrld, ctrl4a, ctrl4b, ssn[8];
759758
char *model;
760759

761760
/* Read all the relevant data from the control registers. */
762761
ds1685_rtc_switch_to_bank1(rtc);
763762
ds1685_rtc_get_ssn(rtc, ssn);
764763
ctrla = rtc->read(rtc, RTC_CTRL_A);
765764
ctrlb = rtc->read(rtc, RTC_CTRL_B);
766-
ctrlc = rtc->read(rtc, RTC_CTRL_C);
767765
ctrld = rtc->read(rtc, RTC_CTRL_D);
768766
ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
769767
ctrl4b = rtc->read(rtc, RTC_EXT_CTRL_4B);

0 commit comments

Comments
 (0)