Skip to content

Commit e5f12a3

Browse files
Ke Sunalexandrebelloni
authored andcommitted
rtc: rv3028: Fix codestyle errors
Compiler warnings: drivers/rtc/rtc-rv3028.c: In function 'rv3028_param_set': drivers/rtc/rtc-rv3028.c:559:20: warning: statement will never be executed [-Wswitch-unreachable] 559 | u8 mode; | ^~~~ drivers/rtc/rtc-rv3028.c: In function 'rv3028_param_get': drivers/rtc/rtc-rv3028.c:526:21: warning: statement will never be executed [-Wswitch-unreachable] 526 | u32 value; | ^~~~~ Fix it by moving the variable declaration to the beginning of the function. Cc: Alessandro Zummo <[email protected]> Cc: Alexandre Belloni <[email protected]> Cc: [email protected] Cc: [email protected] Reported-by: k2ci <[email protected]> Signed-off-by: Ke Sun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 4919d3e commit e5f12a3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/rtc/rtc-rv3028.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,9 @@ static int rv3028_param_get(struct device *dev, struct rtc_param *param)
521521
{
522522
struct rv3028_data *rv3028 = dev_get_drvdata(dev);
523523
int ret;
524+
u32 value;
524525

525526
switch(param->param) {
526-
u32 value;
527-
528527
case RTC_PARAM_BACKUP_SWITCH_MODE:
529528
ret = regmap_read(rv3028->regmap, RV3028_BACKUP, &value);
530529
if (ret < 0)
@@ -554,9 +553,9 @@ static int rv3028_param_get(struct device *dev, struct rtc_param *param)
554553
static int rv3028_param_set(struct device *dev, struct rtc_param *param)
555554
{
556555
struct rv3028_data *rv3028 = dev_get_drvdata(dev);
556+
u8 mode;
557557

558558
switch(param->param) {
559-
u8 mode;
560559
case RTC_PARAM_BACKUP_SWITCH_MODE:
561560
switch (param->uvalue) {
562561
case RTC_BSM_DISABLED:

0 commit comments

Comments
 (0)