From patchwork Fri Nov 18 06:32:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 22118 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp28618wrr; Thu, 17 Nov 2022 22:36:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf44tNXKT732dpaO8Dr85e+oyilsLbMQI0LrCcZRRMZ5YX/tMkcO+I6HPkpN2L34XktWD2EX X-Received: by 2002:a50:fa83:0:b0:461:565e:8779 with SMTP id w3-20020a50fa83000000b00461565e8779mr4973604edr.387.1668753410728; Thu, 17 Nov 2022 22:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668753410; cv=none; d=google.com; s=arc-20160816; b=C7SylbinGF85TL4JCOvzjWgOWAsmlnuob8o96PcEp5BTEfUmU2c8VyH9drm1++ICUs PRChxMFEhP2H/O3t0uMDRFGtKEHVHfTFioNTfrwBNNgzrpo+MH1w1896GyZkauyQTwrS Axll9ph33z0kTzKerKRjHXCUcmMuEjeEXZ0wvhl06lZNGq8np78WyQ7xhrHr6o6hpuxq Qj27jUXHLrAzzDS9Rte0+QsaL2MyLFYRHpYNhobgqqYtYOTYjuxDM8QRR3HFfX8xIT9z FkhjAqb00ZMGGK3vP3GfxsYw3haq5RpZLYdtzx+Ql4IWTBPEVCpbOCZb5ZjqDMm6q/9G Ws+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=cYcoMMN1LdL0hpOrpiQfEhS9xifMLGhRfX/ohuJAQ/8=; b=GeF5ZFJ4DA9JaL6GqOnvoZvRkVdBX/mllko2Hrr4ikPuaCKOQNo0gJWjsCGuloyQ8U VSsKZoglHGxObOppkWBSfYJ8aUu8GGtcTWUA/fdqFVo1F5fRKp0GJe6/ZxqhpPyMSO6O A5AC2AQBATQTqVqyoq6KOdKwBFREQduGFAHDf04MSM3Ba2/SfZa4mDeGRiM0VB5wtPnE f7iyRd4nm9cVUsdEokcZx2IajMYlwotP0CUe/UQF7YdqGJmYj215zZgxJXogOVJ7/+C9 V7Aq/0IT/BguPBo9NQPPzsMsw7KW7XdjZrM9fFveA9Y3Q5kasOqzGHDPRbzXQb+O0iET u8IQ== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho15-20020a1709070e8f00b00781df60a2c8si2190870ejc.342.2022.11.17.22.36.26; Thu, 17 Nov 2022 22:36:50 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240125AbiKRGcq (ORCPT + 99 others); Fri, 18 Nov 2022 01:32:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbiKRGcp (ORCPT ); Fri, 18 Nov 2022 01:32:45 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B77E898260; Thu, 17 Nov 2022 22:32:44 -0800 (PST) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4ND6QL5BMPzHvyc; Fri, 18 Nov 2022 14:32:10 +0800 (CST) Received: from localhost (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 18 Nov 2022 14:32:42 +0800 From: YueHaibing To: , , , , , , CC: , , , YueHaibing Subject: [PATCH net-next] net: ethernet: renesas: rswitch: Fix signedness bug in rswitch_etha_wait_link_verification() Date: Fri, 18 Nov 2022 14:32:40 +0800 Message-ID: <20221118063240.52164-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749814776252507616?= X-GMAIL-MSGID: =?utf-8?q?1749814776252507616?= rswitch_reg_wait() may return negative value, which converts to true later. However rswitch_etha_hw_init() only check it less than zero. Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"") Signed-off-by: YueHaibing --- drivers/net/ethernet/renesas/rswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c index f3d27aef1286..c098b27093ea 100644 --- a/drivers/net/ethernet/renesas/rswitch.c +++ b/drivers/net/ethernet/renesas/rswitch.c @@ -920,7 +920,7 @@ static void rswitch_etha_write_mac_address(struct rswitch_etha *etha, const u8 * etha->addr + MRMAC1); } -static bool rswitch_etha_wait_link_verification(struct rswitch_etha *etha) +static int rswitch_etha_wait_link_verification(struct rswitch_etha *etha) { iowrite32(MLVC_PLV, etha->addr + MLVC);