From patchwork Mon May 9 14:45:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiabing Wan X-Patchwork-Id: 12843704 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C616C433EF for ; Mon, 9 May 2022 14:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237586AbiEIOto (ORCPT ); Mon, 9 May 2022 10:49:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237605AbiEIOtl (ORCPT ); Mon, 9 May 2022 10:49:41 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2132.outbound.protection.outlook.com [40.107.215.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48776186C8; Mon, 9 May 2022 07:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQ6+3ozmw1em8gKi8FhepgyyvNgFO/FvoNIOjYtPFr6sFGzHKHxgun89QR1AHWG0QMpbm5oJYs2ObExdz9cXKg/VelcxB7S7k+jtbiPTR5TzT/B+ardNmNjjjBaASRlNcs6QZf2fMDn3CZa1AJCJVPPHJbm/+UkxHqdUoQtk8DnuTwKvwCVZt433bddn9tU0yCleZvknnEkHy+vaQP9MUzoQF2bdG4AzuuwRZJAdotohUV8DUJ2HUOIZrUWoeDJsr8oQAaIMqY2I5Ms5omIde8ZU8GPZu6CiSpg9Ay4vKPu/RDCYKMA3mA0AwGUDGZhuuzh673fl/dOhN13ZVxn7dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XlsdNskJbKMItaNsiYE0Fugh6vTR9nPjA7aTWclt6UY=; b=A9shnLris7rulnU/z/xV3fA3q1vVJpAMo7bnlsWP8amCQJAfqs5IqsuNv7AgQXfl409XHXfW7zzSCgqUsyyEf5r3TDdMdtCHajpvtfSVm8Sovn2j5JAzc1s8d6VIkwtLQjskCgRq/BX5YypQRM7qvp69xgzsx0DWxxkNVdW5OMB3+td6Upu5VzNOkXZJ5vsdgJLm4pAl4mbrTTWjV5lnuBHUbTG+kYXvO+F8CTnfMw55A0zGu0ecHQnRGfdCP4HLz6vU8M8ACm2RmtkQrVA3BD2ZkxvnR5P3EIKa1iqdVgzFLJQDa7V9vqCXsjjhKQvOFLkOjsA5EX3mUUWiaCW8kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XlsdNskJbKMItaNsiYE0Fugh6vTR9nPjA7aTWclt6UY=; b=Xrm94HjoJOMmyAany1ixTWcTR5ywPHicMyGgcjr322bd/iEVfwKu9Aw49PoBKPoCZ3Eq2w8WdT/cHtDibkuAcGhiK+G/+geF+KQ6UxFj9stin3miPNiPfenQhWvF0nBct9I+meNaTC9EkNGC3Hyor0nu7zroN4z5B8ijra8KlFk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) by TYZPR06MB4096.apcprd06.prod.outlook.com (2603:1096:400:2e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Mon, 9 May 2022 14:45:39 +0000 Received: from SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::4591:4f3e:f951:6c8c]) by SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::4591:4f3e:f951:6c8c%7]) with mapi id 15.20.5227.022; Mon, 9 May 2022 14:45:38 +0000 From: Wan Jiabing To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wan Jiabing Subject: [PATCH v2 net] net: phy: micrel: Fix incorret variable type in micrel Date: Mon, 9 May 2022 22:45:19 +0800 Message-Id: <20220509144519.2343399-1-wanjiabing@vivo.com> X-Mailer: git-send-email 2.36.0 X-ClientProxiedBy: HKAPR04CA0002.apcprd04.prod.outlook.com (2603:1096:203:d0::12) To SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c22bfc60-bc97-457b-5c78-08da31ca94fd X-MS-TrafficTypeDiagnostic: TYZPR06MB4096:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9Dpw0AOiyzw8wDapgUEt9abV9HCyCsReyVRLvuH5OwTGVFpc3wgckntETco4Tb+YgW+AtvA80MhZgxVe7sRICR3DuBpUJyCsvTdCMQS2sLB1Fdo2rUgQFDApRN+v92C1z+9SYkfYukgOLJ0yISBKG/uO71up9z3/9jpA2ILwnFkR6KsMr89WiJlSiAzFOMs/Z/YCg0z4KocQ+BFVmeLqY+ZIIXBNMlryPt1uaBml3UTV51dYpUVChgdK0q+zA0RkrsrnbAbw3e282SOb77lb4j1lMPMBvM0q+mS9w27MfoMTpyPh8YHQMBC3LPuAiC+vIzaK9Xip5dCTF03pGtoqbNPikD0v3OeX2XxNjyTJHzaH2dJVaXLrq8lkFfC/t9JfNjN+OH4nOUbezvjt2bfngmdDwN+8dQonTA0Bfa/VxK1oEMYTeNs6l0ihlBiykGIj321CxrbjiyUObUpB7xuVL5Ra2c7vVW8C3pgOwirGXcHP8iNbklPzRKe41NJ0eyku2t/2Gpuboy9zrMeYTXGMPZJ3dTIvxrjEXqG4vfte1eO5CKG5oMsavFSxbeVg4VQBh9JumusuHpWtfekeb96Lspp+gBPyE5UAjfFdEmRvKJ/6NGOd8oCJNaLEWlU3zW6i1aHsg2yTs7yght60pE5r0OfCZtTqfuGBImzSg/DPhvTLgx65SFhpkG1AdKz5Rk3c6DF50TCo13Q/eD3lMIpdog== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB3367.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(4326008)(8676002)(83380400001)(38100700002)(66556008)(66476007)(66946007)(2906002)(921005)(110136005)(36756003)(508600001)(6666004)(316002)(6506007)(6486002)(52116002)(107886003)(2616005)(26005)(1076003)(7416002)(5660300002)(186003)(86362001)(6512007)(8936002)(38350700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n4opJUGaNeAvIqGxwe6VFnN0Cs3OvqthFP//VFo57ZNYuznPVB+oXnXv9qDwzmFvn21VWfyY5wOxw3PMXiSIgSHdpk4V+y/pB2IBp4qAKNT7aiX9TIg3VR+iPfIbfjGiu0ntOosbJyCEqRxT/s90TlVIQsDrcZ9lh9fsGb2Jkqpb/VslAe02UTusfNTkY40dnSAFVEJdDfR+Syr6fsMf8YbtOSuZqV9SScvnFOj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wALH7X1NifxDck0fhdSKeBW+n8WyNpmnfYit7VHl6KfERvgEXo7TlOzTNR2rqw/zollmAM+kWtEtPgxTk+kStBGbWVgt3aAdtG4r4DgBXd/kVe9zKiP2y1JoNoDAncOHpeYw3saZtDGd0WONvzFrse/X4ocvcCsJsKsOKc86QDwiUP9dEOEcMna1pFk4wnIZ1yvu3YY7kjw5zNyzcitFvn84JSs6Hskbo+0l6yLkSvcDzxzwTuokDdvQdLFm9LlAMYaOp9t1dXzRlopg3G/8qasyILKmTrOT7TuByR4TF38AOHQQ7cHiMTGxTml18UoZGm9x0xtpwTUJnOseIEjzKWlF2dr9AqGjugYPjfEhHMaPSKIuaos1m6Uny8oW1nBiwA9sANbMiQ5Zi364JMadPXxOP1RXmrkhsIwdCVJmsh7GS/YO/v6jBahzV32OQyw0BMSriRAEFIg== X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c22bfc60-bc97-457b-5c78-08da31ca94fd X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB3367.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 14:45:38.1633 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SOQdLDWzkGVwJ6nflpwsfIVdAwB6z7SpY7KRmYF3iAxqfmwokwNC0nl5SzIkKL5TCCAXposawRLN9UDE2pkHYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB4096 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In lanphy_read_page_reg, calling __phy_read() might return a negative error code. Use 'int' to check the error code. Fixes: 7c2dcfa295b1 ("net: phy: micrel: Add support for LAN8804 PHY") Signed-off-by: Wan Jiabing Reviewed-by: Andrew Lunn --- Changelog: v2: - Add a 'Fixes' tag. --- drivers/net/phy/micrel.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index a06661c07ca8..c34a93403d1e 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -1959,7 +1959,7 @@ static int ksz886x_cable_test_get_status(struct phy_device *phydev, static int lanphy_read_page_reg(struct phy_device *phydev, int page, u32 addr) { - u32 data; + int data; phy_lock_mdio_bus(phydev); __phy_write(phydev, LAN_EXT_PAGE_ACCESS_CONTROL, page); @@ -2660,8 +2660,7 @@ static int lan8804_config_init(struct phy_device *phydev) static irqreturn_t lan8814_handle_interrupt(struct phy_device *phydev) { - u16 tsu_irq_status; - int irq_status; + int irq_status, tsu_irq_status; irq_status = phy_read(phydev, LAN8814_INTS); if (irq_status > 0 && (irq_status & LAN8814_INT_LINK))