Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6031125rwd; Mon, 19 Jun 2023 00:58:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ajj6U7cQvE8MlApOcVjKxt6GMvogUC7pnBaE7uj91W63yJyaHjJPeWqFP3M7hD9rQvz7B X-Received: by 2002:a17:903:11cd:b0:1b3:815b:cf02 with SMTP id q13-20020a17090311cd00b001b3815bcf02mr8606652plh.19.1687161534580; Mon, 19 Jun 2023 00:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687161534; cv=none; d=google.com; s=arc-20160816; b=IjGZlxLvFHBWawYg79PVoo1qXAplMDGBBirFsLrf1q0YASs7+IN99owx9+1kosqgKe V8Jas0fvinlLTdcF9oheuz8pIR0Y98a4b293RwUxymbCITkJWthcnh35tOCEggCUllO+ dp2H16p+4LLWw7A0rKCrSWLKgT/3PMtFtbfUmPy9aif5H2EmxkkAdbaXIXcaOErUGj4X 0CtFwOEFQnmBYgmTQc6CNhafd1LUMc38Pp08AdZ1aCuSShYFm56NV4B5np14jog1aQfO V2NTJ2VkOPy3YvgljmQGRQ0hD3uOBc5zowlAt2w2yj5hViAEbQznI6vuZnPglqv34PTQ GLMw== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=sXMm8BTtn4LuF4QqDYp7x7a1KYJB24JTvJCXKTUosLQ=; b=TYWZdwELtaqHVkLChBDAswtdVVXY25Sei5xXET9yG+tIop/vD4HjSqfwvb9TcC6AXA DylqaUS4LmUwODRnCsDr8ZevWkjoInYfl+xicjt2t67KMwcaf6RaNH4R3lvH+dFNHF7h ULgBCekOje0Ucn4pPRoGcvaPxoCxZ+JLxdALysN6Sx+2k/Kpwz74BmFnviVuZLW8Agco B0ZTSGQoYOZrKkjvm1e4HRT/2dKKDBY5YXSM9+WPckB9vkBH35DIBDQ6ejtaeRdDvgHF TafNmOq+4okylh/en++bQy91TLBPPv8wM1Wmn7VZvT17scEc5dmBpJ03Ugy7Qp/hAdkj qAPw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n6-20020a170902d2c600b001aae1eefc9bsi19544732plc.238.2023.06.19.00.58.39; Mon, 19 Jun 2023 00:58:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229875AbjFSHtm (ORCPT + 99 others); Mon, 19 Jun 2023 03:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjFSHtk (ORCPT ); Mon, 19 Jun 2023 03:49:40 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 087B0C0; Mon, 19 Jun 2023 00:49:37 -0700 (PDT) Received: from loongson.cn (unknown [10.180.13.22]) by gateway (Coremail) with SMTP id _____8DxAOmQCJBkr8gGAA--.12251S3; Mon, 19 Jun 2023 15:49:36 +0800 (CST) Received: from [10.180.13.22] (unknown [10.180.13.22]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Ax6OSPCJBk5P8fAA--.24411S3; Mon, 19 Jun 2023 15:49:35 +0800 (CST) Message-ID: Date: Mon, 19 Jun 2023 15:49:12 +0800 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 To: Krzysztof Kozlowski , 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> Content-Language: en-US From: Yingkun Meng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Ax6OSPCJBk5P8fAA--.24411S3 X-CM-SenderInfo: 5phqw55lqjy33q6o00pqjv00gofq/1tbiAQAHDGSO9AIDRgAHsU X-Coremail-Antispam: 1Uk129KBj9xXoW7JrW5Ww15CrWUJF13Ar1rZrc_yoWkGFg_Xw 4q9wn8XFyUJay5Jrs7Kr9FvFyDXr13trn8Jw4rZF1UXwnrJF95Wr15Gwn3JrZrGrWUGr1U Xrn8Wa43u3WUWosvyTuYvTs0mTUanT9S1TB71UUUUj7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUbqkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1ln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r12 6r1DMcIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr4 1lc7I2V7IY0VAS07AlzVAYIcxG8wCY1x0262kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxG rwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km07C267AKxVWUtVW8ZwC20s026c02F40E14 v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkG c2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jFApnUUU UU= X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 2023/6/19 15:00, Krzysztof Kozlowski wrote: > 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. Thanks, got it. Thanks, Yingkun > > Best regards, > Krzysztof