Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6544479rwb; Tue, 9 Aug 2022 18:11:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR6s41iZFrpchgdutw20X4mYvAJX0ZlDWqsiW0hqHQiocAJKreBIkmm3l/Ow2jSpDRK6Frod X-Received: by 2002:a17:90b:2252:b0:1f5:41fc:74ec with SMTP id hk18-20020a17090b225200b001f541fc74ecmr1134475pjb.197.1660093872720; Tue, 09 Aug 2022 18:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660093872; cv=none; d=google.com; s=arc-20160816; b=oylwYAe3MYzJwwRa3UPX0irNSv8yEW7tECY58FM3s2SPDxQ913C2njrIjGi+YLgXXc COP4IlW7A7n0yoiCfpgZCQPk9Tx2s+YO4imLik+gjOebnou7L4C4hThCDVgB1fRTZgQc DxNkbI7aOQu3RN+lLmVnn5NL0txxdHwb3FXPfAtka6BY+WOP8cQDhf+uYcWW/dWxej8s X4pVIux/zdxyJNs8ZPG1xwlAuXZ7WUr+WOuuJC3Rtr/8GgtpIkbcYP8LZnIA3arYb5sA PPmjyC2Jqce+En/lxiUNYBJUQbnR2qjt35sJylVqIy4e3dbsLcJynw8EZmarhF0Zw5l7 bk/Q== 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:dkim-signature; bh=Y+Dpg5er4JcLuWYJp/AnvJVjhqIdNhRlmAXhpETRUSs=; b=LHS3tgtKgBnVddE3ODJA2+KfyLIHbkpTxKBtW7fqKr+V1x5ngtglj80tJSly+sjIh1 xbgxBfNYSE0miEHM81oxR9nnKJyVXOiGbvFJiN2Oc9DYalEKZZwIKFdl/bgb/gVk/n70 Zh3537BAEAFKP4XgHlNSHBIy/Gkc3dn72wGjWVigkn8Qink9/R7/l3elzwaHyC74qtUZ wHPUK0oN8mL8seGriuap/H0GBQLfhQoKKu+dRO3eDdqS+ADZAsMx/+fU76hPwZSh+tjQ iognS2A9zxLwA4NnrPsj0As/1VjVifBD+GUv2tasZyMwq2UlwJdEhHd4b4WyEjjSpBwc E75w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I4WtNltD; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 26-20020a63175a000000b0041255acce87si10206181pgx.92.2022.08.09.18.10.59; Tue, 09 Aug 2022 18:11:12 -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=@kernel.org header.s=k20201202 header.b=I4WtNltD; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229534AbiHJBIh (ORCPT + 99 others); Tue, 9 Aug 2022 21:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiHJBId (ORCPT ); Tue, 9 Aug 2022 21:08:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9EEF70E52 for ; Tue, 9 Aug 2022 18:08:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B9BF6122A for ; Wed, 10 Aug 2022 01:08:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09B7DC433C1; Wed, 10 Aug 2022 01:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660093711; bh=gDpZ800zuPi6XDQp4C0dv++Rl8lv0u6lVZ0kAvYcyxo=; h=From:To:Cc:Subject:Date:From; b=I4WtNltDw7RjbFxENBifLW3+OiG8lw8/Jz0a0jrR+uwxaw+8zEaf9DLpCYzlDEyo6 5jRb7tJkSBdGG+a8nW3sSZ+Q3T3kMFgtjcb9J1yeP+FWTQRhLHNEUpvIc5AnKBMl7u JB80tzys/ze1IShnCWVO/W02G11gRfQesIKCOx15HyD1QmW58+zF9hIs2O/1q0tprI Uzt3W2bIPw9CPvO/tw0Yf6RJG0sFRjfGF7Q/33jrCgjb8TEW2abYzNs1xbMZrAM6+f s3tsJt71azux//4MTS3/Bx9AE+SIHTPQwMKd7ghf7uPsw/2Z4KtuvS0OCz82nuCkze SCdcuNkOjIGyQ== From: Nathan Chancellor To: Codrin Ciubotariu , Liam Girdwood , Mark Brown Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Nick Desaulniers , Tom Rix , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: [PATCH] ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion Date: Tue, 9 Aug 2022 18:08:09 -0700 Message-Id: <20220810010809.2024482-1-nathan@kernel.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 A recent change in clang strengthened its -Wbitfield-constant-conversion to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can only be 0 or -1, not 1: sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion] dev->gclk_enabled = 1; ^ ~ 1 error generated. The actual value of the field is never checked, just that it is not zero, so there is not a real bug here. However, it is simple enough to silence the warning by making the bitfield unsigned, which matches the mchp-spdifrx driver. Fixes: 06ca24e98e6b ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller") Link: https://github.com/ClangBuiltLinux/linux/issues/1686 Link: https://github.com/llvm/llvm-project/commit/82afc9b169a67e8b8a1862fb9c41a2cd974d6691 Signed-off-by: Nathan Chancellor --- sound/soc/atmel/mchp-spdiftx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index 4850a177803d..ab2d7a791f39 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -196,7 +196,7 @@ struct mchp_spdiftx_dev { struct clk *pclk; struct clk *gclk; unsigned int fmt; - int gclk_enabled:1; + unsigned int gclk_enabled:1; }; static inline int mchp_spdiftx_is_running(struct mchp_spdiftx_dev *dev) base-commit: 15205c2829ca2cbb5ece5ceaafe1171a8470e62b -- 2.37.1