From nobody Sun Sep 14 22:43:21 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 843F5C6FA82 for ; Tue, 13 Sep 2022 14:46:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbiIMOqL (ORCPT ); Tue, 13 Sep 2022 10:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234455AbiIMOnh (ORCPT ); Tue, 13 Sep 2022 10:43:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97D0D1ADA2; Tue, 13 Sep 2022 07:23:09 -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 B3A5E614DD; Tue, 13 Sep 2022 14:21:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD8D6C433D7; Tue, 13 Sep 2022 14:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078906; bh=HS2roA9G01cpdQH+6ACcYZ8syFpKwUpCdVOO2iIMwL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CfaPzT0neyo87N65iyIIk9zDEuwVFhqjBYdvkJ3ju6cWVFRlRdxJw84tDhtgTZew8 B3J8ALEgn3KFWup4me7FdITW90vUhAE1hQlNctTOUM32OcCcvBX4oytyb5vww07hiY 5DSIWkSYHA6VcZoUC6RHJ9+S6ab9ApJ4rPC966NQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Mark Brown Subject: [PATCH 5.15 102/121] ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion Date: Tue, 13 Sep 2022 16:04:53 +0200 Message-Id: <20220913140401.736044368@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140357.323297659@linuxfoundation.org> References: <20220913140357.323297659@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Nathan Chancellor commit 5c5c2baad2b55cc0a4b190266889959642298f79 upstream. 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 'i= nt' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-co= nversion] dev->gclk_enabled =3D 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 Controll= er") Link: https://github.com/ClangBuiltLinux/linux/issues/1686 Link: https://github.com/llvm/llvm-project/commit/82afc9b169a67e8b8a1862fb9= c41a2cd974d6691 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20220810010809.2024482-1-nathan@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/atmel/mchp-spdiftx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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; }; =20 static inline int mchp_spdiftx_is_running(struct mchp_spdiftx_dev *dev)