From patchwork Sun Nov 6 10:26:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 16121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1428707wru; Sun, 6 Nov 2022 02:32:20 -0800 (PST) X-Google-Smtp-Source: AMsMyM7EHf5HzPAc80xKVCRsowen6V91Br45qcvwqZCC2AH0GEXQunJb9F3OpSpPun9+MDuW5WMB X-Received: by 2002:a17:902:ced1:b0:186:b18a:d0d5 with SMTP id d17-20020a170902ced100b00186b18ad0d5mr45446847plg.60.1667730740561; Sun, 06 Nov 2022 02:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667730740; cv=none; d=google.com; s=arc-20160816; b=WwOszU0siF8T7DOrkbNjBCVZ3ESz2ag4vQzKWWFNxa3Bc4eAQGmBsTi78f7+L5/z19 jB9/N/6dlFexl7+Dxhb6rYcH4FkLgFYudgowiNIokg0lb61XIPGUfcAvdFgoUxxXwAJX 1skpR2rJITaeughnZFViKEvtDQJYdtFzuUNJMoRGFcGKVNcTwR193rUAHPEZF+/ihX3O Ya7naXNHNQiMFd/mWarHALxqvRIbEKvjkKPUExKDCo18o5L9/RMa79OWpFRrlaoKKr03 OlZzVwm9lXHvGETg9G/qRxjPc8sitfISQa8voGBbAig5NiluL95ePg5IditUD0SovaNI HnYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=wHnDOH+GmyPQZsXy08I778MWPzn1MlHxoTXSkN+hoY0=; b=vWNypCiXxZkCyYq+bOKrQ5HqSge/StJKh8o2IaHUVYli7QTguyDQgPT+O8ISex6ZF2 0p578b4Eo8jAyqw2roJZhrfnqmdxfP4zy2ciWvKLLR8BWq4ew1IGOvuHIx9e74xrFDvI oE9jyhrfMaFlQu6nXBSJkPe8MAAlW2FDpayTLS33CnfFKD6qNY+BHl7bj0BKuEMStYT/ yswCrz4bo7lVd99V4IhLVizX3STA7MMi87niD7OAwrJQRundFpMwYOYtCiG0GJfNIzys iPdtdk03MR1zt+xYnR5WhjCCniKuV8M3EM+PpV4e/rRgLEDXwngaqXG8V+khaTIJieQh Bxew== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a624d06000000b0056381876081si5974117pfb.328.2022.11.06.02.32.07; Sun, 06 Nov 2022 02:32:20 -0800 (PST) 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 S229852AbiKFKbr (ORCPT + 99 others); Sun, 6 Nov 2022 05:31:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbiKFKbq (ORCPT ); Sun, 6 Nov 2022 05:31:46 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 624275F98 for ; Sun, 6 Nov 2022 02:31:36 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 6 Nov 2022 18:26:38 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.29] Date: Sun, 6 Nov 2022 18:26:38 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: chenhuacai@kernel.org, kernel@xen0n.name, zhangqing@loongson.cn Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] LoongArch: Fix unsigned comparison with less than zero X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <63425a0e.b8.1844c7a5d80.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwD3C+Lei2djsoYBAA--.50W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQATB2FEYx0CNQAEs9 X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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?1748742429070540525?= X-GMAIL-MSGID: =?utf-8?q?1748742429070540525?= Eliminate the following coccicheck warning: ./arch/loongarch/kernel/unwind_prologue.c:84:5-13: WARNING: Unsigned expression compared with zero: frame_ra < 0 Signed-off-by: KaiLong Wang --- arch/loongarch/kernel/unwind_prologue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/loongarch/kernel/unwind_prologue.c b/arch/loongarch/kernel/unwind_prologue.c index b206d9159205..58ccdbe7fa22 100644 --- a/arch/loongarch/kernel/unwind_prologue.c +++ b/arch/loongarch/kernel/unwind_prologue.c @@ -43,7 +43,8 @@ static bool unwind_by_prologue(struct unwind_state *state) { struct stack_info *info = &state->stack_info; union loongarch_instruction *ip, *ip_end; - unsigned long frame_size = 0, frame_ra = -1; + unsigned long frame_size = 0; + long frame_ra = -1; unsigned long size, offset, pc = state->pc; if (state->sp >= info->end || state->sp < info->begin)