Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2417158pxb; Wed, 9 Feb 2022 18:54:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLSYRDJH6ImSqXut0QxJ2SXimoqJEX3CkLx9AFlI9A+B9OpVATOLrXR/TvbXdd7pJupQTG X-Received: by 2002:a05:6402:2710:: with SMTP id y16mr5456328edd.350.1644461644365; Wed, 09 Feb 2022 18:54:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644461644; cv=pass; d=google.com; s=arc-20160816; b=K5HabJ8fRJtQjbmPCj2+FXpTF91dwHCgWMjaI901+skpGCe5JG+sz9YZPwQgjD0nQL wLIALqrZNbPigoN5AwXY9H0PuIx+yAgZYgU8i1I+h5ZkCFjFZTly8mdQCI4Mn5pjzvEU Ca+Qe6L8yV5hXdSIsAC0XotJB2PIn8TECtYe4afUBHRlrSQz7o2n1q1EqiGXG7Qa46e+ 1pzuHaF5j9U+91Jb83eA8uq6EvnNx6ILydc4G3L5uHLA64B5GVJp+sECbiN8WzyUHpEe o0VCGd5Tag9hYsx9W44K6w154VRwjN1I1Odi3qF7ZvI254kdVCDcydVXuFXIHdKl7c2a V5KA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=lU5ixG5Icbbe63D1lJvUoWI96o5esydDCBJlUeIuLmw=; b=R2f86jGMcFOVSOvTuWeUnFaywJxtVYU12EP5bskesx8+xHyyPaA9PX51+fNGYOGQpj VEdzDa3BJks4qtrqaEAm0IAhMzeBlqn5t26GFxODYmNCbBaEWv4uLuZScAfUpwawo0TG RBPFo2cHnUOFMRhH4RqmtYWVa8LzYBWekVyhLJ2OWCzSDKcvlbUTx8NOXA9gP3jrEKqf CdO4HDONlFkJT8dKltBSmWOqvWLspSv9nnnXNauiDEjYbLoh0R7eBxWt4OJmBVD2tOC6 im0UgDr6Lu24ET6RP+CoCPLzJBPeXolFP2QqsQ3FldkySyE2TGtJxU11CGKqZKdj1Rd2 KnYw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=MmuO8Zp1; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QveRU759; arc=pass (i=1); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg7si11735507ejc.696.2022.02.09.18.53.40; Wed, 09 Feb 2022 18:54:04 -0800 (PST) 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; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=MmuO8Zp1; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QveRU759; arc=pass (i=1); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231437AbiBJCfp (ORCPT + 99 others); Wed, 9 Feb 2022 21:35:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbiBJCfe (ORCPT ); Wed, 9 Feb 2022 21:35:34 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C26FB237D3; Wed, 9 Feb 2022 18:35:36 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21A0AQ7Z017462; Thu, 10 Feb 2022 00:30:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=corp-2021-07-09; bh=lU5ixG5Icbbe63D1lJvUoWI96o5esydDCBJlUeIuLmw=; b=MmuO8Zp13ICbQezk1Bto/XLg4ydqgOBVrGEw0Rg4ZhvLBbnldKbOkilBcEwcS+f4dSwV qRC2wRSHiTpTC13VQzB7gmejor9ekmgTpPaucEYk3TgyI1kFgv1jAPalzKjUXrVHa5Y+ D8uQYJ0dR9+LEkvo5wvdXimpShyMXjOLtY1kvOuziFh0YqJTHvVhaU3okCOjvLzbXrn3 S+ysruCXPl+//PUhHAtV+gg28c2cq18wTlxUFEkpGtSsvdrxXrGmzRjeD+edDiOz7BXY RuytvI5shsKEVC0IMA0QrFre4mUUQex9Tb++3GorxsSk7nzAUReSC2hoXOzfDw2hCMsN Dw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3e3h28p5qc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Feb 2022 00:30:38 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 21A0G9VB153756; Thu, 10 Feb 2022 00:30:37 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by aserp3030.oracle.com with ESMTP id 3e1f9j9rbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Feb 2022 00:30:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bxLGD1VHe4tudCz32Iyt3NYkBxDMsDz1Dvq8e0ZwaYuS48X7XW3x3aMfAQor9GkO4R5kbRgA8e70mPk3iznmc6F1xyt14AFAMwR+zi60BW+Pu1rH8hJnrEE7cstN/a7xeN7SBMobZkURGFE0LDMK2IoJE/KkQKMnFVTMZ/2Y5xnkjBH/uiN1zAtZHQeDD9YIxqDIUyYrfLVjCCC9NMCXI6xVvFU8quD/kG/+9CeqXwb4byknkGW6tvTWqsjd33vgTaIKnbmkhMf83HkGPMmZlRUw5fysd+fVPkw6hr5Tw1yuBj+Twdrd/+EFHVBeEKy+htSCm61fXcnKBP/FI24+6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lU5ixG5Icbbe63D1lJvUoWI96o5esydDCBJlUeIuLmw=; b=aw8Kxh8l0Q6PuO7kTFNyIO9t8IEn1d9RL7CI6whF9L8PZIYPAu/XWkHqBW8WGP5ltUiFulpjr6YJFY6khehfqWYF9jtTmrwQec79PvZ0VekU/3AfW6G3atRDlScmbldi6w+d/IbtBmUAmwW7rbFwKWD6IPQmfk0oEtF21o7vkRd04BhMjsfAe1JCZNx8OhaczaF6WQu6/g7NYecC6kiES/Bzj5ZHY/LavFItWW25DHP2VpydWoRyTQ8lFhgHkAkPmGLZDIuFvgjP+SmJL5NZbUaikAy9kVliR1alrMYRuvfojFr5bn1Ir+y6zQaLSPDi1rkwiQymFPDuvpDr9qqrYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lU5ixG5Icbbe63D1lJvUoWI96o5esydDCBJlUeIuLmw=; b=QveRU759UqXLG3xiaN8X6Zv2lxpmt6bS4hGWczgnLJCeQuJLDlYS3Y7fhFgmY6zANysZkLoWfL4Z3tmXQUnqT3xko2gWZCcYA2f0ysZAWnwqTaxAMUKyJviolkLfjypcSbK658z0FtcjAtk93L9iaiJOV5ZJTLVgqNk/9RkH/MY= Received: from PH0PR10MB4472.namprd10.prod.outlook.com (2603:10b6:510:30::13) by SN6PR10MB2701.namprd10.prod.outlook.com (2603:10b6:805:45::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 10 Feb 2022 00:30:34 +0000 Received: from PH0PR10MB4472.namprd10.prod.outlook.com ([fe80::94eb:56d8:7cd8:ca76]) by PH0PR10MB4472.namprd10.prod.outlook.com ([fe80::94eb:56d8:7cd8:ca76%5]) with mapi id 15.20.4951.019; Thu, 10 Feb 2022 00:30:34 +0000 From: Victor Erminpour To: a.zummo@towertech.it Cc: alexandre.belloni@bootlin.com, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, trivial@kernel.org, victor.erminpour@oracle.com Subject: [PATCH] rtc: pcf8523: Fix GCC 12 warning Date: Wed, 9 Feb 2022 16:30:27 -0800 Message-Id: <1644453027-886-1-git-send-email-victor.erminpour@oracle.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain X-ClientProxiedBy: SN4PR0501CA0058.namprd05.prod.outlook.com (2603:10b6:803:41::35) To PH0PR10MB4472.namprd10.prod.outlook.com (2603:10b6:510:30::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91f7a4a7-5d32-40e0-c64f-08d9ec2c8d6c X-MS-TrafficTypeDiagnostic: SN6PR10MB2701:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:873; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VotnsYCnondm1YZd7TVqiMVOPzJnzMvvIaJtLKXeT9Nakx0yYG1/7vWw/tERc/vLroALEekSbvUtNzKmRArkOUVeKJPHPkj5UVLmmwYH7i7utyU27SJbXetoFwKf7WDAERum0mzls5RNiuTHQkCosnCnOONhdEQLcsVnnHqqVUna8Qd+JYc4Fvhfk2HYfzRwNx/D9W/iHyGBtLJ1+24zPbduTuvh8Qpx2VGEh38xw0TDYuEaP/OmBwpGGvebc9hRMzhLpM+Z2C07RKA+gFovNMnKYY/7n6bRMdVSI9iuu7nQZopG3+R+H50CCDwHRoYjR4RPFYlkV23U0alwcOmvgXI6zsRr1T8LZR8XRb6Pm8Gd1qarb333KJsLeG/TBymdcVKQ8dSX/ozbKNue2s43/gV/1aIw7pBnPp0uPZ/lrxLW3NRYtP8Z/R8Z/4uYexfIBvgP47m+1XLBPxIhZtUUkN52Tvke4eCiQLq7z3rda7VEo0SparMwsQ06ch+9h7HdFTF0cBUttzg7dnxSKOc6TqZcaaJZ3DgcIaye+phy7pqIobTNlTU/LfBoNROVZ1S0q2nPwB75QcNzfVa0KIzENKJWGt5yKiKz26e/1mFAc6OTd85I4P6oOe11se4Di7CZV8LcjURmfgqtLCtlR3wLS4JFBXE7/fFUB8OYqk0WsKD/KImnPCoIPSFGt3kjIzNTlHYUcMr9wKSRmf3i7xEc0g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB4472.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(83380400001)(8676002)(38350700002)(186003)(4326008)(8936002)(107886003)(26005)(316002)(5660300002)(6916009)(66476007)(66556008)(66946007)(36756003)(6666004)(6486002)(6512007)(52116002)(6506007)(44832011)(2616005)(508600001)(38100700002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?D7a96bNUJqWI/3xaZ+0QvtcoHjp6N1DjX/plQ75ts4yq1bdcAFOEBBdNcR7U?= =?us-ascii?Q?6E3wvX7ndtQyGiaQXbdl5HTtXv9gyMGzd0OMZbdiKnZncLcyR8z+5Ey0PSR/?= =?us-ascii?Q?jfOjo5fvQT/3fKHcWFQGpxVYubey0MHMZs84ZCXkbnEC77rQDWKsKMVoig6+?= =?us-ascii?Q?ULVFySuq3F88gHVgqBLmHZI67/vYpDwULBOKhDKctbndCyLtEuHpOiV801/4?= =?us-ascii?Q?sVdeyePQBYMXRI+z8FYOnyE6fT27oXElTnloDT3dnUnHQpdM7ek3Z50fxMsK?= =?us-ascii?Q?iiyZoqeOe2DDVkn/R0cVe/C/0ppz5taCAVmScC4l6NBX23cM8zDcv3KnUDmV?= =?us-ascii?Q?i1bnl/7WrkUVW9RoVG/FloH3oifCMqDKlKJ40nM4XiU7q2HcgtTK1Jla9Dm/?= =?us-ascii?Q?0kkNt4dk+EMjzDSPskajvzUfFk3/w2O/EaWi9mZr2CWB2vH9wDPfJVa3bkj6?= =?us-ascii?Q?eNUz9nhmREr21vgzsGuBlrbnciwHm+sJc/u4EY22JybgWjoRAqvZaPS3eKLp?= =?us-ascii?Q?1c/r9j9SFvzw8zSpVzPeXYpX3N061oa3R6WrACTM9Kp/r2tN6iveOvJqinrX?= =?us-ascii?Q?nZZJRbAVazR+cE7+46PYR0U+Aeh+OnKUlcpqiQz9HPA1rIZ3a6StsmyG03Yn?= =?us-ascii?Q?tsaeDCzNJKwrIY1j8LEDHB1TrCkuSkBA9LxNwQqhN8vaANLU8bB2G+1Ho51U?= =?us-ascii?Q?ONVXfZWQFl/EMnolGC1G9mfaRVwB1F+nXyw3goAMc4w4ucY5l2c7qcvSRpdo?= =?us-ascii?Q?BrZcmrT6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PijYeAk1YqLcRPzkPr?= =?us-ascii?Q?v9LQTg=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91f7a4a7-5d32-40e0-c64f-08d9ec2c8d6c X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4472.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 00:30:34.6786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vpPnCD/PelbhxzPKNXyKPJ1IsL/g3XZyJsy4XrLiJU4anP/sYlhcm8iVeVRVhngKzVAg/gsHmca+cb0yMd9V893JXfnkknIysYSPQL+d2/I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2701 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10253 signatures=673431 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202100000 X-Proofpoint-ORIG-GUID: s5pTDQbunDLUe0lM7RbVSrJIwElIpOWP X-Proofpoint-GUID: s5pTDQbunDLUe0lM7RbVSrJIwElIpOWP X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 When building with automatic stack variable initialization, GCC 12 complains about variables defined outside of switch case statements. Move variables outside the switch, which silences warnings: ./drivers/rtc/rtc-pcf8523.c:284:20: error: statement will never be executed [-Werror=switch-unreachable] 284 | u8 mode; | ./drivers/rtc/rtc-pcf8523.c:245:21: error: statement will never be executed [-Werror=switch-unreachable] 245 | u32 value; | ^~~~~ Signed-off-by: Victor Erminpour --- drivers/rtc/rtc-pcf8523.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c index c93acade7205..baa89f431ebd 100644 --- a/drivers/rtc/rtc-pcf8523.c +++ b/drivers/rtc/rtc-pcf8523.c @@ -240,9 +240,9 @@ static int pcf8523_param_get(struct device *dev, struct rtc_param *param) { struct pcf8523 *pcf8523 = dev_get_drvdata(dev); int ret; + u32 value; switch(param->param) { - u32 value; case RTC_PARAM_BACKUP_SWITCH_MODE: ret = regmap_read(pcf8523->regmap, PCF8523_REG_CONTROL3, &value); @@ -279,9 +279,9 @@ static int pcf8523_param_get(struct device *dev, struct rtc_param *param) static int pcf8523_param_set(struct device *dev, struct rtc_param *param) { struct pcf8523 *pcf8523 = dev_get_drvdata(dev); + u8 mode; switch(param->param) { - u8 mode; case RTC_PARAM_BACKUP_SWITCH_MODE: switch (param->uvalue) { case RTC_BSM_DISABLED: