From patchwork Wed Apr 19 11:45:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 85352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp324937vqo; Wed, 19 Apr 2023 04:55:33 -0700 (PDT) X-Google-Smtp-Source: AKy350at6ilfXABWZwFn1ePCW5WvHj9ET/2go8ekBmtiiaBPhrWf2XUhDu0GBxaqsW1vxZsSE3vu X-Received: by 2002:a17:902:f314:b0:1a6:7fb1:8de7 with SMTP id c20-20020a170902f31400b001a67fb18de7mr3981141ple.24.1681905333389; Wed, 19 Apr 2023 04:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681905333; cv=none; d=google.com; s=arc-20160816; b=eSMdzojs8X6p2baYE9Wv8iYj2Z6wMfYx4Uuqfd+xSg6Cm1mQ32Pyx1kjAAHsl9qUrG gTj0wDDWg9fnnive3PKd+07pquWYz5aW6CJI26X5KLzoCr3iyd6WCRgUKQypMJd/AMI5 JPLdaZitHBy33W4vsYVp+9Kf3oyh6DYp3k5o4f4PP3wcTvEY5/rFvh+xLCKFT/hkzegZ gQ/whi9/gBcbl2R0VQmJq1ovTqERV+mnPf7KfadkktWgMHGb2JqWLjD2w3Bn6NBwaN7i DfjEUm1y5zBUjkf5zKl4uQZb7bZoot9eigzXignOVlHvLpJqfeZymZmQyqRscky3lM1I vmlg== 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=48Fdybgl6zU/oMbET3BAcvPSOWVRdreg6C3JhLjDH/w=; b=Cpq/NO/AyNB0nE1Lz/FCZU+cST9HV9h0Hq0+RFYUg7iAu1kLqLt8caCk2soiDHd/+A eQyLMhuF9VOKcdMBptG6R8i5EWFmB6qgAS4QbYtKMc5IXN7KSzSWyFNSQglr7QLyhsMV yuNHUlXAQiKsqDVblTvoKM8xNSPoqWYOMEXAkBIcq2zKgzzanRjalt6CDupwwV3eaADl t5hhgfwhb0fb9eRBk2/JSTPPXbln43ZEiCuMu313y63I+9e5S82XL8cmNo9tEGkNwvsl rlgc2MonVsDOTM6NaKDUmBHwj4SQkgfUV2s7V8iRfCmcF33maNtLIfaYc9jdijwNRMuZ f8IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pjoRgABh; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a1709026b4c00b001a5264640basi16184619plt.413.2023.04.19.04.55.18; Wed, 19 Apr 2023 04:55:33 -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=pjoRgABh; 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 S232704AbjDSLp5 (ORCPT + 99 others); Wed, 19 Apr 2023 07:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231592AbjDSLp4 (ORCPT ); Wed, 19 Apr 2023 07:45:56 -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 23EF3196 for ; Wed, 19 Apr 2023 04:45:55 -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 B41CE63E04 for ; Wed, 19 Apr 2023 11:45:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A53D3C433EF; Wed, 19 Apr 2023 11:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681904754; bh=0EimNkwL3NzqPyYJdRFVT8tpM9/mvdkOg05MG6AIYZ4=; h=From:To:Cc:Subject:Date:From; b=pjoRgABhi15Q0t2nLYVz7bbdt2nxD+ZqRwMiJdIXKyGO2bRFnAHrSY25L/Eg27VA3 f6X3o0Wz6jRwJOQ/kmwX/BwgATGbM1qMyiZSAcnIKE5naPS/i57iL2t0DyP85zNDXw liX5LuRkHVFxPSC2ySeZ/+MCRvILg4M7IhYLidYdPLuhd0ez8XJcH1wX3CL3fDyX+5 t6VIkE/MHK8u1id89Mw22aj2rM7sv+rDkAU9G0G2eK/I3YqVQhJXyAx3R0qn3WjdOJ 7jxKOY3sSvs7aNsJcXAPyvrU9idhAw5xeTOnm8WfNXe9RnhSPXXhWJu5YKAl32kNKG CVpBjkrmrk88Q== From: Arnd Bergmann To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Nathan Chancellor , Nick Desaulniers , David Lin Cc: Arnd Bergmann , Tom Rix , Peter Rosin , Dmitry Torokhov , Hans Verkuil , Charles Keepax , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] ASoC: nau8825: fix delay time range check Date: Wed, 19 Apr 2023 13:45:39 +0200 Message-Id: <20230419114546.820921-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763605567114156926?= X-GMAIL-MSGID: =?utf-8?q?1763605567114156926?= From: Arnd Bergmann clang points out that the recently added range check is nonsensical: sound/soc/codecs/nau8825.c:2826:31: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare] if (nau8825->adc_delay < 125 && nau8825->adc_delay > 500) ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ The DT binding document confirms that the intention is to warn if it's outside of the 125..500 range, so do that instead. Fixes: fc0b096c9291 ("ASoC: nau8825: Add delay control for input path") Signed-off-by: Arnd Bergmann --- sound/soc/codecs/nau8825.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index c4389f5fe603..f4eb999761a4 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -2823,7 +2823,7 @@ static int nau8825_read_device_properties(struct device *dev, ret = device_property_read_u32(dev, "nuvoton,adc-delay-ms", &nau8825->adc_delay); if (ret) nau8825->adc_delay = 125; - if (nau8825->adc_delay < 125 && nau8825->adc_delay > 500) + if (nau8825->adc_delay < 125 || nau8825->adc_delay > 500) dev_warn(dev, "Please set the suitable delay time!\n"); nau8825->mclk = devm_clk_get(dev, "mclk");