Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753077AbdDFVWA (ORCPT ); Thu, 6 Apr 2017 17:22:00 -0400 Received: from mail-cys01nam02on0075.outbound.protection.outlook.com ([104.47.37.75]:27565 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751039AbdDFVVv (ORCPT ); Thu, 6 Apr 2017 17:21:51 -0400 Authentication-Results: canonical.com; dkim=none (message not signed) header.d=none;canonical.com; dmarc=none action=none header.from=cavium.com; Date: Thu, 6 Apr 2017 14:21:42 -0700 (PDT) From: Himanshu Madhani X-X-Sender: hmadhani@deathstar.local To: Colin King cc: qla2xxx-upstream@qlogic.com, "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] scsi: qla2xxx: remove some redundant pointer assignments In-Reply-To: <20170406111957.17250-1-colin.king@canonical.com> Message-ID: References: <20170406111957.17250-1-colin.king@canonical.com> User-Agent: Alpine 2.21 (OSX 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [173.186.134.106] X-ClientProxiedBy: MWHPR01CA0003.prod.exchangelabs.com (10.168.201.141) To SN1PR0701MB1839.namprd07.prod.outlook.com (10.162.100.156) X-MS-Office365-Filtering-Correlation-Id: e580e2f7-1790-4b65-901d-08d47d32ee75 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:SN1PR0701MB1839; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1839;3:ycs5562h6t+nLEeHBsFk+MjgtraDL8PfF0ihROsuztR1lWG9MCo9fOEpiy6hnqRD+pwS7wG+Rk3e8hsPrbEYRIHpc3ByipQGiahoxCNfCCrrr5SdrC8Aq0DKKgC304snZQe1gXyrGcm3i56dtMIIaNaXtay+NBZtRtdcly/j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BUyu29DiNkPHz7er+1cIzQ8KgS6v4rbTR8mjfx7FOnjlz35FGwdsXOuJlJ/pfQvuhaB9H+mqHmseXZ9EmTX9LtLf16bAq1/DrpY1t812ZUp6dEEYVlbFqN49SCr2hJ9ThsU+uzZQNy16JD2nLK3zZ5RErYA/GOPJnKeo9Ps/BAQltru3ckJJwl+IPpqY71chipCDDP/3PpRhKgacar7lvDt0tKw4Fa7UdWQzOq5XFh9oG7EkU9SjZUxc61qpXutdyd7hqBESukqQaHFd/mzBAlNk/K/7bQhlhDjCA5PxDUq7H/AICgYjNnuRJYZ0+8+OfAyrAgxvdQ6oVSPGGQktHphkTH9xkeC0lehqPPLwgG1BXofPhw1j5/Ze6mU34atn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(198206253151910); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:SN1PR0701MB1839;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0701MB1839; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1839;4:kdc+VWGMikZCG0uT7BmogeqTHnwLEW04UZkR6XQ3J0jB0swq/f9STiNf/9tPGnm/JwdIvgqTBYuvexLSrkzZEKQiLsZb6Q4jAH5uHJEVXPdMevcSs1rknIgTxGqOyDEhC6cs2XzjA0U/Q2coEnDLwdy/JDLg6ceWOIPlQWu4DDlNq3YZvIfiYG2vtnsv0KvzvvpOwbTKpqR3vrGGLgOgx/nJOA4BKpDW2d72HVbqgM6gxBePYcZOLZT0adRQku0zisK+GcXQtgjgs9+W2V8ZxyVcWP5qGTO26B5syaF9/pu/UVVv6jpps//NCDcdD4UaI/oXobvPwJSO+D8mRwUj8/Ag8MhHZEbaVcq8C7AA0vfW9b7JJA0dZ1k1k/iwFTjHzWpOb2PS+DbSzXOezhOiwGWsGGRQIhhhEZAGfNbEo4iZxA0LckXN+Yco1TgKKYDXdIhtm35291hCvfylHFJWcTS454bV7grNeWfMwhsIGXSeJNhbMYNWhS14GyRJrY0p+qkow0DFB+EpSixnhAq/cfDOrPvjcvIPh83JkqujSYpC3ssbpRBiB6t534X+8eg+wj6vxtcwM1IaoeAQUE/pAXp0nDiPAqxlTbYe+fApcee7TV1cmPliHdyfw0kTE2AkpJf9N1LXINoDfbRFdXrtvpxvCNCTfZTd6QXOMY+b91G5nRMSiqMEs+LUbwakjeQn4CWCPIy2F7Cwd3fnCnoM+oQ9zoyvIg5F+IMBmc0kGdi6UiQxHopUjMrGl9mpSiX0 X-Forefront-PRVS: 02698DF457 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(24454002)(54906002)(2906002)(38730400002)(47776003)(83506001)(4001350100001)(6486002)(77096006)(110136004)(90366009)(86362001)(5660300001)(23726003)(9686003)(3846002)(53936002)(50466002)(6116002)(2950100002)(6916009)(4326008)(305945005)(7736002)(189998001)(66066001)(42186005)(5005980100005)(6666003)(25786009)(8676002)(98436002)(50986999)(76176999)(54356999)(229853002)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0701MB1839;H:[10.29.102.35];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1839;23:XQREf5oracj8zUxzQ+UkMtPphgMF7NSl18IfLhW?= =?us-ascii?Q?GfdyXJ55e56rc+I3gYZ1H1uPZapn4JSVV1/Gx6k5K8O3EU4JBknAG1v24ES5?= =?us-ascii?Q?mIAN5SZEWg2ZaduybjVzG974rkuRHGVbHwXrVVJwdTn3MEb9Wo6SxvBfl4ww?= =?us-ascii?Q?T1hRYS+7NkKthsqb69bP3PgQAOpCNAlzBMTPADCM9C3yXqIM7n7AsnEVGfA4?= =?us-ascii?Q?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Dyv1wi4683YUhb9Ep2f?= =?us-ascii?Q?BjDiTgcPZqhY=3D?= X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1839;6:YilzkrPkvUc5eiSUii0lNhWPjeEubuV5oGnXVXWeGE17r91bl92Nyg3R/6p2FJITA1TLyAANM0WhiA64/NLnrVx2sF7Y3DB3T3O0fDyq68dYSwTHqeTtpDA83Ex1RucQU23zW1Y5/DDWTP92+aaoxFf1UneiYTFw8iQRwaWZD5YrXlF4jJiNmhgNjwfe5EuuRpW51RpQlXBBIdx5dxu7aWpwiTwMYEImcypxSmfeN+wtmnqEq+tNKhXedeLxNTWJbay50hRC2NNAAKlHCk7etGBki9GFQkBi/0ciZfz7r3vHsNyVxGUFeRZRUteG3h3w9nJXjqktd14t5dSs5h49FmnSLk95axssxGXpEI7aOWqDfiaUo/t3sRRebOoPxl1BxCNMstHL8pOu4CEG97fEtg==;5:J14qOtBolOYyYS83CRhhvovMMAWPW6SM/wKckVXvr7O9GR9RNN0ybRN/PQ9B/thP5OKLU3mopUjqTGnRSP1y5GU22/jk2NRDA88FvMKD8OOEmocFpT2uUiHqdOvUE+JDOSaOA3un64DRFuKVV9g8eg==;24:nCbxBmLJTyjFj9PM5vOihMPaltmlxZXrPbZmGbGe3fGG4Xk/lGcjTOuHLk3+19qoTGbUsergdInDvpXbkiYJlXF2Xz44RXH+K9qGNTcVVpc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1839;7:Df3qL3zNmLx7cUay4XsBAk8qPmwiRMYPkHwEkN4lj5e44CeqRzwhtWM8xb+B7xRA6wc5VMEnqBp9vZREIwVWS35L0dsfwxJRDXeKE5Ku3ERoIcACwIY1SFdiMyyBLpVxYKyKhmxJO0xbFSyQDToX7qkyqtWMb4/UWbRWLouS9H3hcPmt0DTpp/ZVIhrMAzdV5jaiqDfY4oDsTqr4pj4h/ZqycMyzWj0N7lbfDwdGaazGcQWBE0SNE0wkQLN1VOh+V3WHkhFe//ln74hjnk/pbQ2B8OPIH08jIW9IYYR8WQPHyNGCf7QBIssXxbMHcXUEPx0DPXv3BFPYc869kkubhg== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2017 21:21:45.5549 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1839 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2198 Lines: 77 On Thu, 6 Apr 2017, 4:19am, Colin King wrote: > From: Colin Ian King > > There are several local or function parameter pointers that are > being assigned NULL after a kfree where and these have no effect > and hence can be removed. > > Fixes various cppcheck warnings: > > "Assignment of function parameter has no effect outside the > function. Did you forget dereferencing it" > > Signed-off-by: Colin Ian King > --- > drivers/scsi/qla2xxx/qla_os.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c > index 83d61d2142e9..1c7957903283 100644 > --- a/drivers/scsi/qla2xxx/qla_os.c > +++ b/drivers/scsi/qla2xxx/qla_os.c > @@ -423,7 +423,6 @@ static void qla2x00_free_req_que(struct qla_hw_data *ha, struct req_que *req) > kfree(req->outstanding_cmds); > > kfree(req); > - req = NULL; > } > > static void qla2x00_free_rsp_que(struct qla_hw_data *ha, struct rsp_que *rsp) > @@ -439,7 +438,6 @@ static void qla2x00_free_rsp_que(struct qla_hw_data *ha, struct rsp_que *rsp) > rsp->ring, rsp->dma); > } > kfree(rsp); > - rsp = NULL; > } > > static void qla2x00_free_queues(struct qla_hw_data *ha) > @@ -653,7 +651,6 @@ qla2x00_sp_free_dma(void *ptr) > ha->gbl_dsd_inuse -= ctx1->dsd_use_cnt; > ha->gbl_dsd_avail += ctx1->dsd_use_cnt; > mempool_free(ctx1, ha->ctx_mempool); > - ctx1 = NULL; > } > > CMD_SP(cmd) = NULL; > @@ -3256,7 +3253,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) > } > pci_release_selected_regions(ha->pdev, ha->bars); > kfree(ha); > - ha = NULL; > > probe_out: > pci_disable_device(pdev); > @@ -3504,7 +3500,6 @@ qla2x00_remove_one(struct pci_dev *pdev) > > pci_release_selected_regions(ha->pdev, ha->bars); > kfree(ha); > - ha = NULL; > > pci_disable_pcie_error_reporting(pdev); > > @@ -3568,7 +3563,6 @@ void qla2x00_free_fcports(struct scsi_qla_host *vha) > list_del(&fcport->list); > qla2x00_clear_loop_id(fcport); > kfree(fcport); > - fcport = NULL; > } > } > > Looks Good. Acked-By: Himanshu Madhani