From patchwork Wed Mar 10 16:01:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhi Li X-Patchwork-Id: 12128279 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 BB88AC433E0 for ; Wed, 10 Mar 2021 16:03:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 455F564EFC for ; Wed, 10 Mar 2021 16:03:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 455F564EFC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=AZBVeRk8zDahtV2QQS3cAK3jsboWs4a0lR4sh6BwDO0=; b=X9ESrG5/ailnvw comrKBQrntJF0uwPsKGLJF6WfLXUQOMoD9ptLkHyLE3UikGSfgdjjKMesYips/2k2asiZA9vxQynb mQQLJMHo6jEX1QQnKjbIPn7LATu8MgBVR7cxQTfMocweapJbDTk9buyCPEhafiiSu9uKcKzTM8cCm S4sFfq5fUHJ7brwVEKKOKcPXpSqqqixDTuApDa3Sdbm43zSlNs8pyxas1Lxpp6eDe6AstHlD2E3wL CgVnKute/jxTGeW5Fk4BOiHDHa2lp2uzWeUtB9Vlb1Zda7ZfMdiC9V08w8APV1xnlsrp1GdWIq4Ne hO1MLVpiGdIVnHJB3CKg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lK1HD-007A5A-7I; Wed, 10 Mar 2021 16:01:35 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lK1H7-007A4C-RM for linux-arm-kernel@lists.infradead.org; Wed, 10 Mar 2021 16:01:31 +0000 Received: by mail-ot1-x329.google.com with SMTP id r24so8731725otp.12 for ; Wed, 10 Mar 2021 08:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=71Szmz88lWkywP/rY1VQkY3dGVzVAAC4awFIIbB0qVU=; b=DBMZmzT8UUJ4RgXCy/finQ46AwfEskP1MX+gjjw936NOKTsK4pp6mdHezya/F/MLqY RkjToRBf1/mOa0RYdpYKsZ5T6nE2DWfmq1nfYXDv1vfRV3WRuue3vdBXkMY8IJhMvwa5 e2X5sGNumxHIPxjiowzMhqbaXUFbuyuSH+SSLpZ1MjujarAod6t7nH2osbx2BRo/7oWr KOLxl9oycJcsava3CM5D+tMhXSqoRAuHdnioK7+zUZ1tyELPxThrIxZuJ39D/fvRKKMa Yc2XHCQgTLdabjmWE2hMzKRyvIaTA3nEv5igpinhc2OPM1YklCPlQAk7cmH8ux5juQPr f4Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=71Szmz88lWkywP/rY1VQkY3dGVzVAAC4awFIIbB0qVU=; b=h961MOz8zaqjj2mJ94tFjzfjSkdfrC9+RtKWUrVibl6FprmKYtEsxcsjw9yiedCCRG FFfUpTxeChETwxSwxN0bn6/wwzgBRiZsuPDXCalOq9SfBFqVnlYMrm6mMILGxFTNfB8d pyImnQBTqdqbVqoWxiUlEuDz3oxdkpqVPMe1BeOWx+poOaBgFXaJu0UbOsNdwV75ddfB jbvE9pCC/+X9ymH1qvISuIQCqHVWzrdL93Tg8yzfJw4aSMVBop4YkHdZ/bOPckTPSxuF KLsEg/kpX2BcH5bD0d4ZbiC6axvPxbp9kfQFbFFQmTJwMp79KC/TpHXD6740zbkxs0D9 jofQ== X-Gm-Message-State: AOAM532GPFnvTMaHaz+GPJbhQ0B1IQyDi2zKb3aPRpqvFB7EjNggPB++ 4YGXWbJExHly5SwM3pYqQAE= X-Google-Smtp-Source: ABdhPJyyavsJ//LpaGkss3IbKK1FWHD8GXkkwHAc6PNsZroUvFSescEi7YXPF9FufJ8Jx+eFZg1irA== X-Received: by 2002:a9d:6a9:: with SMTP id 38mr3109447otx.365.1615392087111; Wed, 10 Mar 2021 08:01:27 -0800 (PST) Received: from ruiqi-desktop.lan (072-177-087-193.res.spectrum.com. [72.177.87.193]) by smtp.gmail.com with ESMTPSA id y11sm3614811oov.9.2021.03.10.08.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 08:01:26 -0800 (PST) From: Frank Li X-Google-Original-From: Frank Li To: peter.chen@kernel.org, pawell@cadence.com, a-govindraju@ti.com, linux-imx@nxp.com, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lznuaa@gmail.com, dan.carpenter@oracle.com Subject: [PATCH 1/1] usb: cdns3: fix static checker warning. Date: Wed, 10 Mar 2021 10:01:25 -0600 Message-Id: <20210310160125.810157-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210310_160129_998576_9C76F28B X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The patch c450e48eb570: "usb: cdns3: add power lost support for system resume" from Feb 18, 2021, leads to the following static checker warning: drivers/usb/cdns3/core.c:551 cdns_resume() error: uninitialized symbol 'ret'. drivers/usb/cdns3/core.c 544 545 if (!role_changed) { 546 if (cdns->role == USB_ROLE_HOST) 547 ret = cdns_drd_host_on(cdns); 548 else if (cdns->role == USB_ROLE_DEVICE) 549 ret = cdns_drd_gadget_on(cdns); "ret" is uninitialized at else branch. Signed-off-by: Frank Li --- drivers/usb/cdns3/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 5d486c8a9d99..bb739d88179f 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -527,7 +527,7 @@ int cdns_resume(struct cdns *cdns, u8 set_active) struct device *dev = cdns->dev; enum usb_role real_role; bool role_changed = false; - int ret; + int ret = 0; if (cdns_power_is_lost(cdns)) { if (cdns->role_sw) {