From patchwork Thu Apr 14 12:52:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Wang X-Patchwork-Id: 8835921 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA6999F3A0 for ; Thu, 14 Apr 2016 12:52:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 115BB20256 for ; Thu, 14 Apr 2016 12:52:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3AA6F2025A for ; Thu, 14 Apr 2016 12:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753356AbcDNMwZ (ORCPT ); Thu, 14 Apr 2016 08:52:25 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:35791 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753330AbcDNMwW (ORCPT ); Thu, 14 Apr 2016 08:52:22 -0400 Received: by mail-lf0-f65.google.com with SMTP id o124so12052661lfb.2 for ; Thu, 14 Apr 2016 05:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=gTg0n5GvC4RTKuCK5EJRiFwAAZswsIb9Sy7wHfPN/lA=; b=JmlzKxH0t93SuuLSTDWMTKb3i7QKa+N3OC5rR6fY3Zx2CM3Oeg1JzWqFPH3qgIJ70R IPfqhPRdMAvI7jVjUaqtAZEryY9I2UaOWH8MyZdfSJ8t1X7iQ0IL/Ic5kc1EXC23Qdnd w4AIFoI8HMpemRgwen1PDeTDnP5lFUC135/9cxxE7lx2b/HB97KYVo/Y1bXoctbTULM/ Girmz3oOernKFjfigITnjvFgsXnySNTE/D7FeouHIGllSxMUbjTqgRn9uvUR3SG+b6OJ yFLJzn5uQ6GqlUlE1LyEkFVhgDstyh89HVmiMtAOCi7DWjlRIIllf38r8PMMnzBFaLVc fh2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=gTg0n5GvC4RTKuCK5EJRiFwAAZswsIb9Sy7wHfPN/lA=; b=NY3SYc4ehYQGriykJLYs/lH4fiUVyTEbkES0TVA/qVKxFOfgBZUuzbcT3TmacbZOm0 0om9S1WBkmZsBMnRVgcr4XrFKW3rfYPPLZzjIPTw8WqoHek0ef3sMDz72eqNzDvJiFu/ d7AsFGi+ivhYH4dBqsdcakvrJNa5prWY+l2ItulJKFrcNnLS0G39aY94+7LzZfAmujJW dpucQaCYe1c9zG6U29lrQLlXWu99buvlvSHEZYL+ef0KSD1ZIKHbGxwTx8GlxHpcQgI+ gR50QcXGYp27eopymD5yS1CrTzFcy0Ti+m6xJn9BwSpwunBqBt+9aQZpT7y/Yq/6aC2h aIWA== X-Gm-Message-State: AOPr4FXY6Um2T0X97YP7j9ROYdfEhyaiO71yfTdvjhlc0bC1AjGxQNhmGvTBAlxrUwAOFU8qGCmf9OgGV9EREA== MIME-Version: 1.0 X-Received: by 10.112.132.36 with SMTP id or4mr6221028lbb.71.1460638340565; Thu, 14 Apr 2016 05:52:20 -0700 (PDT) Received: by 10.25.83.148 with HTTP; Thu, 14 Apr 2016 05:52:20 -0700 (PDT) In-Reply-To: <20160413112454.GA25247@mwanda> References: <20160413112454.GA25247@mwanda> Date: Thu, 14 Apr 2016 14:52:20 +0200 Message-ID: Subject: Re: [SCSI] pm80xx: Phy settings support for motherboard controller. From: Jack Wang To: Dan Carpenter Cc: Anand Kumar Santhanam , "pmchba@pmcs.com" , "linux-scsi@vger.kernel.org" Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,BIGNUM_EMAILS, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2016-04-13 13:24 GMT+02:00 Dan Carpenter : > Hello Anand Kumar Santhanam, > > The patch 279094079a44: "[SCSI] pm80xx: Phy settings support for > motherboard controller." from Sep 18, 2013, leads to the following > static checker warning: > > drivers/scsi/pm8001/pm80xx_hwi.c:4554 mpi_set_phy_profile_req() > error: uninitialized symbol 'tag'. > Thanks for reporting, attached patch should fix the warning. From e30af801d9ee9979b2a7a2af815cb395c2255a09 Mon Sep 17 00:00:00 2001 From: Jack Wang Date: Thu, 14 Apr 2016 14:38:57 +0200 Subject: [PATCH] pm80xx: avoid to use invalid tag Fix static checker warning: drivers/scsi/pm8001/pm80xx_hwi.c:4554 mpi_set_phy_profile_req() error: uninitialized symbol 'tag'. Reported-by: Dan Carpenter dan.carpenter@oracle.com Signed-off-by: Jack Wang --- drivers/scsi/pm8001/pm80xx_hwi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index eb4fee6..a3c1c08 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4548,8 +4548,10 @@ void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha, memset(&payload, 0, sizeof(payload)); rc = pm8001_tag_alloc(pm8001_ha, &tag); - if (rc) + if (rc) { PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("Invalid tag\n")); + return; + } circularQ = &pm8001_ha->inbnd_q_tbl[0]; payload.tag = cpu_to_le32(tag); payload.ppc_phyid = (((operation & 0xF) << 8) | (phyid & 0xFF)); @@ -4590,8 +4592,10 @@ void pm8001_set_phy_profile_single(struct pm8001_hba_info *pm8001_ha, memset(&payload, 0, sizeof(payload)); rc = pm8001_tag_alloc(pm8001_ha, &tag); - if (rc) + if (rc) { PM8001_INIT_DBG(pm8001_ha, pm8001_printk("Invalid tag")); + return; + } circularQ = &pm8001_ha->inbnd_q_tbl[0]; opc = OPC_INB_SET_PHY_PROFILE; -- 1.9.1