From patchwork Mon Aug 24 07:28:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ye Bin X-Patchwork-Id: 259504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AFDBC433E1 for ; Mon, 24 Aug 2020 07:28:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14B682087D for ; Mon, 24 Aug 2020 07:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725963AbgHXH2x (ORCPT ); Mon, 24 Aug 2020 03:28:53 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55864 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725836AbgHXH2w (ORCPT ); Mon, 24 Aug 2020 03:28:52 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DDE765EE57E064C60290; Mon, 24 Aug 2020 15:28:47 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Mon, 24 Aug 2020 15:28:41 +0800 From: Ye Bin To: , , , , CC: Ye Bin Subject: [PATCH] mt76:: Fix unsigned expression compared with zero in mt76x02_dfs_create_sequence and mt76x02_dfs_add_event_to_sequence Date: Mon, 24 Aug 2020 15:28:26 +0800 Message-ID: <20200824072826.136922-1-yebin10@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Ye Bin --- drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c index ff6a9e4daac0..b29cd39dc176 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c @@ -429,11 +429,11 @@ static int mt76x02_dfs_create_sequence(struct mt76x02_dev *dev, { struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; struct mt76x02_dfs_sw_detector_params *sw_params; - u32 width_delta, with_sum, factor, cur_pri; + u32 width_delta, with_sum; struct mt76x02_dfs_sequence seq, *seq_p; struct mt76x02_dfs_event_rb *event_rb; struct mt76x02_dfs_event *cur_event; - int i, j, end, pri; + int i, j, end, pri, factor, cur_pri; event_rb = event->engine == 2 ? &dfs_pd->event_rb[1] : &dfs_pd->event_rb[0]; @@ -517,7 +517,7 @@ static u16 mt76x02_dfs_add_event_to_sequence(struct mt76x02_dev *dev, struct mt76x02_dfs_sw_detector_params *sw_params; struct mt76x02_dfs_sequence *seq, *tmp_seq; u16 max_seq_len = 0; - u32 factor, pri; + int factor, pri; sw_params = &dfs_pd->sw_dpd_params; list_for_each_entry_safe(seq, tmp_seq, &dfs_pd->sequences, head) {