Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp229599imi; Thu, 21 Jul 2022 20:20:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVJKfyKsu71sjFfnDGkhiWBOEe3Z81mGem4DUoFy5RsMx//AyAcCpOOxHqDXNyYY/TwOKh X-Received: by 2002:a63:1246:0:b0:41a:58f:9fee with SMTP id 6-20020a631246000000b0041a058f9feemr1303820pgs.413.1658460035954; Thu, 21 Jul 2022 20:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658460035; cv=none; d=google.com; s=arc-20160816; b=WI745f4TK31NDZoICoDgcGZ8zQ4HK5YR+g4Qo9AWzHZo83V2GxK0r1S7WVUOQ0j9KM XRobiviQnmcI1jjbKJzvN6hpzim3drTr+kl2497MfH9ZHaWhLhbJu2cPqnQCBcABbKMy rXUCS3Rb1ox93jBWcwAf604nUEWiumWlv57C3ZbOKK3KyfzSpM+7BhrG7qwmcAycNwJT jRHqVpHTmrqLT4aC1ozCgNZX50UNofucQUpsCxSeMBH+GuM9XCEC+JSP0A/HxsKAjuyo t08qQ7q5JKr+5sVIOLeSjoZEpe25ziJozAWoCf1G8mPOV4LWNuJW7LY0UJUxLvfqW1p6 lQog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6RrpQCTZGhxeRqBobX6SS51aW3saGPeaCKa0VekUZqs=; b=pd2wTRPx+ry5RIH1f0DAMcJlqdizcNC6y0F5MCQVwoNofD3pJu/6wMJ/pqxxZLB3oL 9JS1ic9DvmOgit5RxyqRSC3koFvq/iSG0Ertm17HZJOFIllzyblPhDBVlouZaNvMSEJc tJy5ksQBV/iF2SXo+7Y8AS1e1Q/Emrt87CkQDR5WSMCpXz9Q19V/7HGKtVXmtmxb5m9K cTnKoXnQ72MFicOjNE+bpIHMaAn5N7HqZKOIn0rA8FAxSvGqM6+jaCG/SC7CVzABeYyI NABdn0tLgf5Wh2uqrDF5cPBss7bLhbFCeDMTnFv+Rzvd5ke9cadm/T2T+9Ofl+hKgCyE ccUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RGPZQ+JO; 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 h9-20020a056a001a4900b0052831347555si4050289pfv.325.2022.07.21.20.20.21; Thu, 21 Jul 2022 20:20:35 -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=RGPZQ+JO; 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 S233099AbiGVCl6 (ORCPT + 99 others); Thu, 21 Jul 2022 22:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230153AbiGVCl5 (ORCPT ); Thu, 21 Jul 2022 22:41:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A312868A2 for ; Thu, 21 Jul 2022 19:41:56 -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 ams.source.kernel.org (Postfix) with ESMTPS id 1CE35B8262D for ; Fri, 22 Jul 2022 02:41:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1D27C341C6 for ; Fri, 22 Jul 2022 02:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658457713; bh=xavck+mfMP0z5ZogTwR3JahixUh3QtLQC7XQ95ds+s4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RGPZQ+JOTZy9DExehtfHBMU6uUSrn/iSwMM4exLjNqIyFFOLnoyWY8W8+F4AXr6M6 tvacNhWotErN1SL2YXw7AlFoVIv60QRxHlFge9V7NySlktLRLIrGk11g6uJM0bqK0U a4PoUGGgsg/dAnwLTnZC2DsRgwP1dy8EKH2n93ygfI9yrdfK/a+AJ2BqK2jPCVGNre Q4n82gFd8Qhh4rxIU3/S8qss85PXr4q88GKrRpreRJjs4T3YAffZ97En7I6LzOYgA2 VevKqXz2OojziVOIc5oBuFk3UGNGDDeZbSviT+au33MMHmkhstNEAfXUtcORSdICOv dpl7NZxtEg8uA== Received: by mail-vk1-f172.google.com with SMTP id o10so1545096vkl.3 for ; Thu, 21 Jul 2022 19:41:53 -0700 (PDT) X-Gm-Message-State: AJIora/Q/SK98jY8t9E8RPxNDfcDmNVkDL/Hpg2ARLoDCaUtf+wfKoB4 s7lXUMXL4z9b2Oj+fER8w6kUx6Aljps8zkdifNY= X-Received: by 2002:a1f:a887:0:b0:36c:8458:b061 with SMTP id r129-20020a1fa887000000b0036c8458b061mr412967vke.19.1658457712542; Thu, 21 Jul 2022 19:41:52 -0700 (PDT) MIME-Version: 1.0 References: <20220722004231.91114-1-yang.lee@linux.alibaba.com> In-Reply-To: <20220722004231.91114-1-yang.lee@linux.alibaba.com> From: Huacai Chen Date: Fri, 22 Jul 2022 10:41:39 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -next] LoongArch: Fix unsigned comparison with less than zero To: Yang Li Cc: WANG Xuerui , loongarch@lists.linux.dev, LKML , Abaci Robot Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.8 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 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 Hi, Yang Li, Thank you for your patch. This looks good to me and will be queued for 5.20, since Marc said he will not rebase his branch. :) Huacai On Fri, Jul 22, 2022 at 8:42 AM Yang Li wrote: > > The return from the call to get_timer_irq() is int, it can be > a negative error code, however this is being assigned to an > unsigned int variable 'irq', so making 'irq' an int. > > Eliminate the following coccicheck warning: > ./arch/loongarch/kernel/time.c:146:5-8: WARNING: Unsigned expression compared with zero: irq < 0 > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > arch/loongarch/kernel/time.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c > index 79dc5eddf504..786735dcc8d6 100644 > --- a/arch/loongarch/kernel/time.c > +++ b/arch/loongarch/kernel/time.c > @@ -135,7 +135,7 @@ static int get_timer_irq(void) > > int constant_clockevent_init(void) > { > - unsigned int irq; > + int irq; > unsigned int cpu = smp_processor_id(); > unsigned long min_delta = 0x600; > unsigned long max_delta = (1UL << 48) - 1; > -- > 2.20.1.7.g153144c >