Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5624461iog; Thu, 23 Jun 2022 01:52:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t3o4KsiTPPw6FxiCKVOfZlrWeYOhLQtdQSKqN+0rYXp6LaOoshkjBezhir6l7vAeU0EnPG X-Received: by 2002:aa7:d29a:0:b0:435:705f:1319 with SMTP id w26-20020aa7d29a000000b00435705f1319mr9185340edq.54.1655974369504; Thu, 23 Jun 2022 01:52:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655974369; cv=none; d=google.com; s=arc-20160816; b=0D9nEd066vyJTNEFGYtp0UGFalj0VPmX8vYG/irTpNiHg7bxlHRP/tbeNTdE9BFKHp e1dTpyPOKUZNyqryDM7k4j5U76oFxQmRYjng8y5CLi6HzEmD5zvePE4P0rbrobcGANs+ 7vGR3pgZsfOdAyuKrFsvRYF6RTOuC6O/zsdnQPRo3WhjTWfmI1Py/XNM71vcwv9709R5 Rt1HE4SAtwIGRy683HHd9hQTNZ2jvYKztGGpcsdVmJY8grhsTKq+NO/3wCKJD6fuYbom LsKVnZbFbTUjVCHm1itVfbR4N5dVkoybAXyleDOuJnMaadRVkppmZcxfWZNplw0XJeWl w9lw== 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; bh=3PC615yuB9vDTSZm2tKZfhjPcVJ2vJf3ybUmSST6gm0=; b=biMbpjVXp5Zx4ytz2Lzk7ohwAa5SRKfloX2ZQamOkfMMcpdg4udZCafXqP6DZGJArD 0cqKzOtXJJFoxk7Aqj9p6hDnpuaPYP9ea6Zbsfp+I9fTAxFg9H8V6sB+oOAw6C6ToDmX inixJdIMYCe/QyPUygX41fboXLveohf9W/GwVLuvHczlCc7lhHYq6oOKT2YQTIdYLv9d EIb6seprLgthwOCVb3FwwvWE6mbxx1FaGCbbtYFzPhHfzPxe4z0kSUw6ouOSfOTajt2G rpIUqxnuSUlIYhHq511AOcXKMvEJrqiidGwKJh3XPoaCxr3BxYnexIzE44UxlncBoEQr NPNA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m5-20020aa7d345000000b004335d160f73si22161845edr.309.2022.06.23.01.52.24; Thu, 23 Jun 2022 01:52:49 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230345AbiFWIoK (ORCPT + 99 others); Thu, 23 Jun 2022 04:44:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiFWIoI (ORCPT ); Thu, 23 Jun 2022 04:44:08 -0400 Received: from out199-10.us.a.mail.aliyun.com (out199-10.us.a.mail.aliyun.com [47.90.199.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 424B649249; Thu, 23 Jun 2022 01:44:05 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R911e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0VHAjc-P_1655973829; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VHAjc-P_1655973829) by smtp.aliyun-inc.com; Thu, 23 Jun 2022 16:44:00 +0800 From: Jiapeng Chong To: neal_liu@aspeedtech.com Cc: balbi@kernel.org, gregkh@linuxfoundation.org, joel@jms.id.au, andrew@aj.id.au, sumit.semwal@linaro.org, christian.koenig@amd.com, linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Jiapeng Chong Subject: [PATCH] usb: gadget: Fix unsigned comparison with less than zero Date: Thu, 23 Jun 2022 16:43:47 +0800 Message-Id: <20220623084347.38207-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 This was found by coccicheck: ./drivers/usb/gadget/udc/aspeed_udc.c:496:8-13: WARNING: Unsigned expression compared with zero: chunk >= 0. Signed-off-by: Jiapeng Chong --- drivers/usb/gadget/udc/aspeed_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c index 1fc15228ff15..387a7abdcee4 100644 --- a/drivers/usb/gadget/udc/aspeed_udc.c +++ b/drivers/usb/gadget/udc/aspeed_udc.c @@ -476,8 +476,8 @@ static int ast_dma_descriptor_setup(struct ast_udc_ep *ep, u32 dma_buf, { struct ast_udc_dev *udc = ep->udc; struct device *dev = &udc->pdev->dev; - u32 offset, chunk; - int count, last; + u32 offset; + int count, last, chunk; if (!ep->descs) { dev_warn(dev, "%s: Empty DMA descs list failure\n", -- 2.20.1.7.g153144c