Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7405558rwn; Tue, 13 Sep 2022 20:33:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR6crJ2pxXNonPjiBKtR4Kck4xmuuLK+qyVmJfXoJAFGdH9oTQ3IMWDJPVE8pVeMfdWGnBm6 X-Received: by 2002:a05:6402:1a4f:b0:44e:f731:f7d5 with SMTP id bf15-20020a0564021a4f00b0044ef731f7d5mr28180737edb.357.1663126407107; Tue, 13 Sep 2022 20:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663126407; cv=none; d=google.com; s=arc-20160816; b=QTeBMmjke1/jwzVKEbvsWnxuSwaHGugG+Pq+fsY/H0tYGbQ5YCOyxzmXOfgjIUm9l1 PHhQ2Xci9FAfpmjDs+843RpnL5wovVFgDCrq7l59Y62KiyytGkmt4wqTHgyH3/zcKIlV LkUScb7JnTNOmT9d5JPJkZWgN6teSpzsyiJdVlnv0B7sfEbuKvDVbbSC4XsQySHO7SFZ Fl/y34hLHjmxh5ji1F1UGQ+OVOcfvH+u6Z8faU7fzVbP8Mo3f00omTZJONv4dBX+SesD 86wUftOvZxFatOlsR7L6CHzu9CnliSyBy6kuvQ4Il8TH1wQ+9Uv0wzmu1sed32z7qYt0 Y/yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MAYzqsNXhJ7NrfvzNWwW1ykVxjuume8Guse5S9ioDxs=; b=KCjPZOubvD5N5QohbtXdJevjPMPcXIqL+YTUA583vGMB0Ej3NgaPWuWiO/OndPj7Kn 693NxdLD90mEyp040USHMi+B0CY45k3ZOgy4+cE1aI1qftgGDe+6DomOWesfjgrzHzAS UDJbhD3yftgpkg1yCjf1VHwAFFtgOS7iNT/lH3y+R85pMXWmhGZ6JDn5BRe69CrY3j/l PE+GkRukfPlOLlkWiyGE+ZdiKNd+nVTNrTAd088RJLTAfQBrB7XRTsrQsDOrkQsQPoEb EyBZwtnYKWg/T3bZveKy/Sev5jJrSzwp2SbBSUje4vSgXCKD5GnGkJjIN77DEDabMW4k YE0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id os4-20020a170906af6400b00741a16e8562si8849913ejb.826.2022.09.13.20.32.59; Tue, 13 Sep 2022 20:33:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiINDTs (ORCPT + 99 others); Tue, 13 Sep 2022 23:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiINDTo (ORCPT ); Tue, 13 Sep 2022 23:19:44 -0400 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C760910543; Tue, 13 Sep 2022 20:19:43 -0700 (PDT) Received: by mail-pl1-f181.google.com with SMTP id x1so13804297plv.5; Tue, 13 Sep 2022 20:19:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=MAYzqsNXhJ7NrfvzNWwW1ykVxjuume8Guse5S9ioDxs=; b=SmrNpCrkFnDYAQSAU29LQeKM97im0bfBWPdDffuj3xUT/gJhjDqV4kIUKTBsuSSZSn Pba8aOPnNxZbV1cUuyLRcnfzkqfZ2yqBsSmpCAdLgzfd43YqUYJp9K7YF7ozTWe0Egkq tL0Rh4rzpm04SwZHtBqYNsNwcHKie+BK1oo8x8tNiBb8x/cb71XwV9onbuD14ckrc7QO HW8qUzkEn2FKTsux+f+IuKG49J9I9sfMoEkh4usjrArWVHl405Pr3DJeOVHEO+ao5n2F aTHJY4tu1d7UWuKItNH3MMSh2A9UdjjyoqW/nULe8t0ErfwBIa9XLyz4xtkfcwCoUI+U /Qlw== X-Gm-Message-State: ACgBeo21G2XXE9IqrFhHDt8wffsIwAJI+rXkS7xyiws2JXZu2lKN1bjy ZuZRulxt394adJ8V9rAEM2eXCJxc6hmhj9Ws X-Received: by 2002:a17:90b:1810:b0:202:c6d7:98a4 with SMTP id lw16-20020a17090b181000b00202c6d798a4mr2451109pjb.16.1663125583288; Tue, 13 Sep 2022 20:19:43 -0700 (PDT) Received: from sk-Yoga-14sARH-2021.lan (144.34.241.68.16clouds.com. [144.34.241.68]) by smtp.gmail.com with ESMTPSA id t67-20020a625f46000000b0053b8ea1c4f3sm8732747pfb.135.2022.09.13.20.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 20:19:42 -0700 (PDT) From: Ke Sun To: Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Cc: Ke Sun , linux-kernel@vger.kernel.org, k2ci Subject: [PATCH] rtc: rv3028: Fix codestyle errors Date: Wed, 14 Sep 2022 11:19:36 +0800 Message-Id: <20220914031936.3493647-1-sunke@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Alexandre Belloni Cc: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reported-by: k2ci Signed-off-by: Ke Sun --- drivers/rtc/rtc-rv3028.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c index cdc623b3e365..dd170e3efd83 100644 --- a/drivers/rtc/rtc-rv3028.c +++ b/drivers/rtc/rtc-rv3028.c @@ -521,10 +521,9 @@ static int rv3028_param_get(struct device *dev, struct rtc_param *param) { struct rv3028_data *rv3028 = dev_get_drvdata(dev); int ret; + u32 value; switch(param->param) { - u32 value; - case RTC_PARAM_BACKUP_SWITCH_MODE: ret = regmap_read(rv3028->regmap, RV3028_BACKUP, &value); if (ret < 0) @@ -554,9 +553,9 @@ static int rv3028_param_get(struct device *dev, struct rtc_param *param) static int rv3028_param_set(struct device *dev, struct rtc_param *param) { struct rv3028_data *rv3028 = dev_get_drvdata(dev); + u8 mode; switch(param->param) { - u8 mode; case RTC_PARAM_BACKUP_SWITCH_MODE: switch (param->uvalue) { case RTC_BSM_DISABLED: -- 2.25.1