Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6010082rwd; Mon, 19 Jun 2023 00:32:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7oG9F3DYtxMEcfAbduvFvJke/HIB2hkyhR7dFkDsaM4Mppo88QKXxSW1yyYoP956GtkTKc X-Received: by 2002:a17:90b:108f:b0:25b:c44a:e0a6 with SMTP id gj15-20020a17090b108f00b0025bc44ae0a6mr7039302pjb.1.1687159929028; Mon, 19 Jun 2023 00:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687159929; cv=none; d=google.com; s=arc-20160816; b=sMAgDdj3ncFqgbFrMHntNAZwqf/xwmHH/tHyyymfnYSqmYML2AquYjkwdjbU5EWFLr 5J8y4ZlWyABOXgo9Y13+oOe0emgU1MntP4DmKnVVxI5/eaSlQAhg+yP9Y/0TYfyfmkPb T6XUpxXVDlvqrFpqCITXi3bzP8tmxIvrnbfh5ylt65AljKnQhtX+3KCKPZBsWq+tsg5K OyLFSQUqUqhmadMKfClHY4q1RfwOLuk0CD3BloBJYQd+lG4+pM7fZjbo6XE3+nDKLHcO uAo0cIZQopr5/cPLAvNQuGmwE4TjM2nSCTekc2EopmejszcJ9t+gHK/n8MFTbyF9fs/L Ib1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=lMrqhOmlYjr3CsiKOPMApGZVFUdNvXXzMH8RRQR9SBo=; b=wTInWXQ8uRnmDoeZg5+E361MtKXIc/cL69vhCbPVpxHU7KDbfIXTKxcWB+GsqTvFa2 tV0HTHZH76QhrhaxymFK6urUcre+tD5nnvmg5FPETgO3ygMmi1GSBc0BToE7Qdawi3wr HL1ld0RAjqm8EWfcaiyPbSF3Ru5IrE8TIHjyNZYY7T1mHA4S+A3ohq5M0BQoTnVDSqcH rq030IgnHGm7MWuZ6l4/beobBn4lNEz2coBT9VTjKWm7/ghg/Ktljz/3WOYQIxrsOaVD J2HeYKrane0a6zJKj+scIS8xJUbRNYC+9sGHw0kJbMhUTySWh1/jwgE6S+uzBZ/h+7gR jmjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gRNXmtBt; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a17090a290e00b00247101dd0c1si7118686pjd.15.2023.06.19.00.31.52; Mon, 19 Jun 2023 00:32:08 -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=@linaro.org header.s=google header.b=gRNXmtBt; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbjFSHAl (ORCPT + 99 others); Mon, 19 Jun 2023 03:00:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjFSHAj (ORCPT ); Mon, 19 Jun 2023 03:00:39 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 740BC1AA for ; Mon, 19 Jun 2023 00:00:38 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-985b04c47c3so439496666b.1 for ; Mon, 19 Jun 2023 00:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687158037; x=1689750037; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lMrqhOmlYjr3CsiKOPMApGZVFUdNvXXzMH8RRQR9SBo=; b=gRNXmtBtp53/JI1qbjCmW/EGDGt/iMPRvcxCm+fL38zqAjrb8riGH6SdDR8ZFXh8+s +g9KmmTgErl4NyhYnvAJ226EPktiSPSNPH7DgA7kF3zHw/4mYC/6TQzgP1Xg8FLKtkkD CmIj6nnjemehAP5fQhc26wYEzk+3X+5wS5D2qokJe4LU4XJ9go+craozn7QkmOur458L pKkVcsO2B6m7Ojk8m+pldwODYC9bdtqPhe1Q1AzT7Pn6IMCqvQxTlD9wONR3f/NJh755 YyYBEAbG3xw+wjm+Vr1yFatM+lXblh+gTB4hbpQwVDZMtEo0guLFiV35VtZczPcmNRi5 zO8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687158037; x=1689750037; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lMrqhOmlYjr3CsiKOPMApGZVFUdNvXXzMH8RRQR9SBo=; b=k/EGzJAF8SXxRIc9TUGWAl8GNiE6sIy12yio3uz8ZMMhZxWTL2S8WDUuryiQ4tpsaH gItJ/gSPsagydcqf/IvctBdpjkBXYKop1HclJeyhvykIZehL3/+9s44ojdqr/OIwRd9V K3m9mFdy6RYU20xclo1spySQE4tkUeq216BfvAzjF7HJ06Z9l11WMaunttHsphe5CXNd +/qmOPCCVKZVZ8SqOZqBM6nZMSMJwuZFyENkPCcKFmkqyuR7SSgYD73X9M7GOA09AMMY Dd0BH9uplha1kxtSCHQuJ+QqqqVTgBrFvxaQ+bc0XqIVnB9GWLE4mh9nEYt8s/szchib v9Ew== X-Gm-Message-State: AC+VfDzabLrYBrnINotZn0prUVT3YL2FXPZnJxZLzxPezc5WYYOqev0n kvy/YX5Z/N56uMz9X48DhbIB0w== X-Received: by 2002:a17:907:7243:b0:986:3783:2949 with SMTP id ds3-20020a170907724300b0098637832949mr8506222ejc.52.1687158036982; Mon, 19 Jun 2023 00:00:36 -0700 (PDT) Received: from [192.168.1.20] ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id n25-20020a05640206d900b0051a594b4eb2sm1103917edy.60.2023.06.19.00.00.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jun 2023 00:00:36 -0700 (PDT) Message-ID: Date: Mon, 19 Jun 2023 09:00:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v4 1/3] ASoC: Add support for Loongson I2S controller Content-Language: en-US To: Yingkun Meng , Harshit Mogalapalli , broonie@kernel.org, lgirdwood@gmail.com Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn, Dan Carpenter , Dan Carpenter , kernel-janitors@vger.kernel.org References: <20230615122718.3412942-1-mengyingkun@loongson.cn> <6901166d-387f-24de-6ffd-1c8eea724718@oracle.com> <325dd825-6fa5-0ebc-4b7e-7acf2d2840e4@loongson.cn> From: Krzysztof Kozlowski In-Reply-To: <325dd825-6fa5-0ebc-4b7e-7acf2d2840e4@loongson.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 19/06/2023 03:45, Yingkun Meng wrote: >>>> +    tx_data->irq = fwnode_irq_get_byname(fwnode, "tx"); >>> >>> Smatch detects that tx_data->irq and rx_data->irq are of type >>> u32(unsigned) so they can never be negative. >>> >>>> +    if (tx_data->irq < 0) { >>>              ^^^^^^^^ This can never be true. >>> >>> Should irq be of type 'int' instead? >>> >>>> +        dev_err(&pdev->dev, "dma tx irq invalid\n"); >>>> +        return tx_data->irq; >>>> +    } >>>> + >>>> +    rx_data->irq = fwnode_irq_get_byname(fwnode, "rx"); >>>> +    if (rx_data->irq < 0) { >>>              ^^^ Same problem here. >>> >>> Should irq >> >> Should 'irq' be of type int instead? >> >> As fwnode_irq_get_byname() returns a integer. >> > Yes, you are right. I will add a patch to fix the type of 'irq' to int. Run smatch and sparse on your code before posting. It would find such trivial mistakes. Best regards, Krzysztof