Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp252616rwj; Sat, 29 Oct 2022 02:30:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6w4wa22efFC+KfHV0GcGLt1C8UOODbTnFkaZhjNQVJ9TZqPrafMlRb66qfPOYNqLs04ggQ X-Received: by 2002:a65:6bd3:0:b0:42b:9117:b9d1 with SMTP id e19-20020a656bd3000000b0042b9117b9d1mr3356483pgw.238.1667035841285; Sat, 29 Oct 2022 02:30:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667035841; cv=pass; d=google.com; s=arc-20160816; b=xu5Ye6gNF7V3VAc3OB8bSe2dUxpULTMYjKfK0XSLLmkOeef1OO385CXpgG6kdMtTEi pQ/S1Bc+gnvzh+h0uWYssrkvxQeDA/TokWGw1oo1pEuX/n1E5fwYA7yayuBK1q0eC8KJ rsk0k0t3F2VLyV6E4tImY8SzOwVulSunx3rrXMshpbpDY9GFys+LrubBlTuRPbUDjoNT kYJUkZb62yy83cSaxciCQG69PutVml6gspNPQej9wV+iYIHriUICG35thWV9m0IO7g2g P8t16C9RNnpQodtHeCTPKyqkxLZt/QSD+TJwrnv2gr4e8ScGIR6hKO25vtx89w3wM27C Uplw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=eCkws9yxCz2AM+qRNTulhQPu8tvKG5qSwE7VrU5c5jM=; b=eZMYg2+4eQSArgMK/t9RMMEhOEJOwt7FKCKNISZs+lrmlV8En/JN5cKd1y2i1ect5a vKdYe5hwRy3Tq2+tG8CiukzWXbuB8oQJpzN5xEzpOrrN53Jq2Yfkx5gRciIvKRKd5D24 Ksk7uQ57tLV8fby6jQFQx15cv9fMXqeRQL6QDJPi6d3PXKefi5WXoLpy5GJMx9EBYGfc As1wYIZB6dI/lCDDBBRGO8ltEecXqgPHl+vwbFkaPT216mzKizE0cIewx5O7bf1PY3l2 PmS91FH21jaKCd2KfvwvkT8VRRnnBQ73KOnpJF0Iu6VCW1WDSlgKhUzkHhGaWBL1ykRS 0JUQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=lQ6gK0q2; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k14-20020a63d84e000000b0046ec396db31si1313619pgj.857.2022.10.29.02.30.30; Sat, 29 Oct 2022 02:30:41 -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; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=lQ6gK0q2; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbiJ2Itu (ORCPT + 99 others); Sat, 29 Oct 2022 04:49:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbiJ2Itr (ORCPT ); Sat, 29 Oct 2022 04:49:47 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2109.outbound.protection.outlook.com [40.107.93.109]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 278DCB1C6; Sat, 29 Oct 2022 01:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UuMq9to0xNaXToZ7k8AGdE+sFRz3Ghz2XbTMKjunrlpcOPZmGcOajCT9sbDYokq9z3U9hY0ZVvdGbZrMUHFIb5mvpa3F/XHqVUOk30P4+aOeN5KuZdMO0StbSoS+XHSdjfDR2ycV6DulFhrsENdF2PtQc06zi3V58J6R8JxTXqeiCOkg0DNzBoxa4gniTnMBkyFnTDhM6pCFzggG4e1ST2PLqVayL1mcEhiTOc+U2xzLLWlONIHBX6NIC8dqDEJnanwlJ5gT1TUH3vR3l7x3vKcLtYi9MgtJAkRpLMUjhZroQJS03zU6riJpEz24e0now3swm7NpXcI9Q3s5IXHfaQ== 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=eCkws9yxCz2AM+qRNTulhQPu8tvKG5qSwE7VrU5c5jM=; b=JngqXEE7fjH4sbO3rK6CbAQDnx2n2Kq0OePniwLHVnpfQu2nh4uGvriUANfrZTUOUd4TGS3gdW3zZNgHiN+cCaKKaVRdae1a4bJO/7PAJea29uevRHA9LZJZQvkWQKDIPRZjOrEohf8kvLFJ36+zZ3EnHkIyiTPlZ9Vr9O+IZV2V4NTAA9xvWeXQ6FYHAXHmYk/lMwDpHYfhCo39yQhRrWBWCkGu2D5cL8+rUda5OTbsFhFp/LReyDqTYo3T0y6Gc7zV0nRMr/gQ2hz2lIUwgsAATCottooPUoGmM6t3jnx98CxJx3U4Jh9GQDxKhX8uOGMNOqQ6T8mgyB+6l1WvMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eCkws9yxCz2AM+qRNTulhQPu8tvKG5qSwE7VrU5c5jM=; b=lQ6gK0q2+Cw/IbVp5InLBMfVr3Uz9MK1Kr+SvcDGOHm9I6ypka7gtzlVfslvIcsYWlP33zWt5R0rWcfHO9inlkWwCojP1RZKnB3tL4zpAReqCzwbzXBCEwHpS1pYGajOjtj4KA+4vvHCFk7GnW1MH2s1B4uUNCoIiXGnjeUuLyg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) by SN2PR01MB2208.prod.exchangelabs.com (2603:10b6:804:a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14; Sat, 29 Oct 2022 08:49:42 +0000 Received: from SN4PR01MB7455.prod.exchangelabs.com ([fe80::44c1:e119:56:cd90]) by SN4PR01MB7455.prod.exchangelabs.com ([fe80::44c1:e119:56:cd90%7]) with mapi id 15.20.5769.015; Sat, 29 Oct 2022 08:49:42 +0000 Message-ID: <0ea97349-afad-e0ab-09c7-f61c782555a0@os.amperecomputing.com> Date: Sat, 29 Oct 2022 15:49:24 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH -next v2] hwmon: (smpro-hwmon) Improve switch statments in smpro_is_visible() Content-Language: en-CA To: Guenter Roeck , Nathan Chancellor Cc: Jean Delvare , Nick Desaulniers , Tom Rix , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev References: <20221027231611.3824800-1-nathan@kernel.org> <20221028181430.GA2079477@roeck-us.net> From: Quan Nguyen In-Reply-To: <20221028181430.GA2079477@roeck-us.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR01MB7455:EE_|SN2PR01MB2208:EE_ X-MS-Office365-Filtering-Correlation-Id: cf73794a-ca7a-498a-3cfa-08dab98a8567 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9dv361zn9yZq9jqSxvohfZxbBMNjkm8dQRmKs2n1M8cl6V7jRrXfd20q9EV1jpQLmPIQKT+j7y25Vr17HxW0zrzzhhMReLw9dx2ef+8UHGpOid52POvuybvvu0pe51MhbDljKcqv/waCHvY8+IBMchQE7kHbrTtwc4VZTGRxiAKjXI3IFkE9EY4To1jDC2yhlgpiX21Ui6olqDoIzAPN30xQ4I6mlHjfraPsIFHagxi96icEE4izNVsvw0/js47ba+Gmi66JdWWoZ4FeIYWwwmBY9ymNDYuydScbm/wq6o3HBdf4ptnrBC6EXQbq8BiTSeKo1YSQVpZiId8b6+yDqucLpegQgFfRPas197NIbmqPkB9Ex/sDcXF/73mlJtdAt/osl6c9b0Nbr95RNYWs0c8+475WLRHDSG5WkGtrcb1yFgwgy9sicGok6MgVN7RnJnpZdU5qy0j74vt7Srsqwj5dhSdtjkDnlpEOEMuCuiA8cvkiRIcSKr/4UE61pP898C4289zH9kK3coxqT74IF6duq5/C84te+VmYD7l0twRTVguycb33YzGxZVQ7UoJ4t2WOoW5rUTkhYC5573c22F9cCBr0X5+7gqBqeDMIpF6I9tkwPs4sW1xGOz0w/pNZHSXL7052X5tZ+DUuwvlgMUb6/gRNd4PBQahym1CR3YxyieSxvmukNtOMYug78Ui6VJrJ6C01Tlxht1B87jMHpZhew8cBm16eVaHje6FzBOyFf9wZ3q7tcwvBSoJuKQZ3P0dI5AN2dPJSGufqmLX+y29vQEXkR7fTJNXn3Wc1otIoPEy7F2qaILi3VQyfeCuooG/9TEfe7Y0mQxA7lp27RAj+9UhZM3BGm5CK7XuDe2U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN4PR01MB7455.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(346002)(39850400004)(136003)(376002)(366004)(451199015)(66556008)(66476007)(2616005)(4326008)(8936002)(186003)(8676002)(478600001)(31696002)(86362001)(316002)(41300700001)(54906003)(38350700002)(38100700002)(110136005)(966005)(83380400001)(2906002)(66946007)(52116002)(53546011)(6506007)(6486002)(26005)(6512007)(5660300002)(6666004)(31686004)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MTgvMk1jTXdobkIzZms0WlJzay9pZjBSNVFseGRZSUVpL2tZM0diVWVIUVNk?= =?utf-8?B?Uzg4UzZtWEhiQVVPbVlHMjhEa1V0dWRnQk9Ba1FDMHdhc2xXcitvU0hjQXpK?= =?utf-8?B?RW14WFI5dWhwQktBNUJUeFRGeVlIaG5FTVNkZWt4cExvOStlOVpYTTVGb1c5?= =?utf-8?B?Y0lBRWNjdVRvUWJGclNxbW1wOThzTGJmUzdyUkkwSXFIRzM2MXNXakg2cjUx?= =?utf-8?B?RjhFUUc0OGhVRzQyb2JKbm9mSWFpMytRMUFITDdSSFBNZERmT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oU2NqU0ozY29uM0owYW5XVkp4WkFRN3I4dUkyb21T?= =?utf-8?B?aTM0YmUzY0hWNXhrd3pOcm55NlVCdmdUUmVpVm9qbW5RcWllVVJmaEZLNEV4?= =?utf-8?Q?Nm7xfzXsmmJXHf4bpg9hpcA=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf73794a-ca7a-498a-3cfa-08dab98a8567 X-MS-Exchange-CrossTenant-AuthSource: SN4PR01MB7455.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2022 08:49:42.2526 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aQJEOmV5BnFswUZtxDzkMWZrgQ3JsSScHhRSWOXlFMfoVQjU1jZ2cJw6u1eLDXpeDrhWKX4okXW3Z/SUAFgZcdAHkMVR0GZVIpgmffuzQOE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR01MB2208 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 Thanks Nathan for the fix. - Quan On 29/10/2022 01:14, Guenter Roeck wrote: > On Thu, Oct 27, 2022 at 04:16:12PM -0700, Nathan Chancellor wrote: >> Clang warns: >> >> drivers/hwmon/smpro-hwmon.c:378:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] >> default: >> ^ >> drivers/hwmon/smpro-hwmon.c:378:2: note: insert 'break;' to avoid fall-through >> default: >> ^ >> break; >> 1 error generated. >> >> Clang is a little more pedantic than GCC, which does not warn when >> falling through to a case that is just break or return. Clang's version >> is more in line with the kernel's own stance in deprecated.rst, which >> states that all switch/case blocks must end in either break, >> fallthrough, continue, goto, or return. >> >> Add the missing break to silence the warning. Additionally, adjust the >> indentation of a break and add a default case to the inner switch >> statement. >> >> Fixes: a87456864cbb ("hwmon: Add Ampere's Altra smpro-hwmon driver") >> Link: https://github.com/ClangBuiltLinux/linux/issues/1751 >> Signed-off-by: Nathan Chancellor > > Applied. > > Thanks, > Guenter > >> --- >> >> v2: >> >> * Add missing default case to inner switch statement (Guenter) >> * Fix indentation of break in inner switch statement (Guenter) >> * Reword commit message to include these changes >> >> v1: https://lore.kernel.org/20221027195238.1789586-1-nathan@kernel.org/ >> >> drivers/hwmon/smpro-hwmon.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> >> base-commit: 0ffb687b6508c36a17b99bdaf014b38532404182 >> >> diff --git a/drivers/hwmon/smpro-hwmon.c b/drivers/hwmon/smpro-hwmon.c >> index ee54e21c2c12..a76c49dd8438 100644 >> --- a/drivers/hwmon/smpro-hwmon.c >> +++ b/drivers/hwmon/smpro-hwmon.c >> @@ -373,8 +373,11 @@ static umode_t smpro_is_visible(const void *data, enum hwmon_sensor_types type, >> ret = regmap_read(hwmon->regmap, temperature[channel].reg, &value); >> if (ret || value == 0xFFFF) >> return 0; >> - break; >> + break; >> + default: >> + break; >> } >> + break; >> default: >> break; >> }