Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754059AbbBKUgr (ORCPT ); Wed, 11 Feb 2015 15:36:47 -0500 Received: from mail-ie0-f176.google.com ([209.85.223.176]:43492 "EHLO mail-ie0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbbBKUgq (ORCPT ); Wed, 11 Feb 2015 15:36:46 -0500 MIME-Version: 1.0 In-Reply-To: <1422717239-6043-1-git-send-email-rickard_strandqvist@spectrumdigital.se> References: <1422717239-6043-1-git-send-email-rickard_strandqvist@spectrumdigital.se> From: David Matlack Date: Wed, 11 Feb 2015 12:36:25 -0800 Message-ID: Subject: Re: [PATCH] staging: slicoss: slicoss: Removed variables that is never used To: Rickard Strandqvist Cc: Lior Dotan , Christopher Harrer , Greg Kroah-Hartman , David Matlack , Monam Agarwal , Dilek Uzulmez , "Paul E. McKenney" , Sean Cleator , Vincent Heuken , devel@driverdev.osuosl.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3995 Lines: 91 On Sat, Jan 31, 2015 at 7:13 AM, Rickard Strandqvist wrote: > Variable was assigned a value that was never used. > I have also removed all the code that thereby serves no purpose. > > This was found using a static code analysis program called cppcheck > > Signed-off-by: Rickard Strandqvist > --- > drivers/staging/slicoss/slicoss.c | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c > index 42d62ef..41b3687 100644 > --- a/drivers/staging/slicoss/slicoss.c > +++ b/drivers/staging/slicoss/slicoss.c > @@ -1395,14 +1395,11 @@ static void slic_cmdq_reset(struct adapter *adapter) > { > struct slic_hostcmd *hcmd; > struct sk_buff *skb; > - u32 outstanding; > > spin_lock_irqsave(&adapter->cmdq_free.lock.lock, > adapter->cmdq_free.lock.flags); > spin_lock_irqsave(&adapter->cmdq_done.lock.lock, > adapter->cmdq_done.lock.flags); > - outstanding = adapter->cmdq_all.count - adapter->cmdq_done.count; > - outstanding -= adapter->cmdq_free.count; > hcmd = adapter->cmdq_all.head; > while (hcmd) { > if (hcmd->busy) { > @@ -1728,7 +1725,6 @@ static u32 slic_rcvqueue_reinsert(struct adapter *adapter, struct sk_buff *skb) > */ > static void slic_link_event_handler(struct adapter *adapter) > { > - int status; > struct slic_shmem *pshmem; > > if (adapter->state != ADAPT_UP) { > @@ -1739,13 +1735,13 @@ static void slic_link_event_handler(struct adapter *adapter) > pshmem = (struct slic_shmem *)(unsigned long)adapter->phys_shmem; > > #if BITS_PER_LONG == 64 > - status = slic_upr_request(adapter, > + slic_upr_request(adapter, > SLIC_UPR_RLSR, > SLIC_GET_ADDR_LOW(&pshmem->linkstatus), > SLIC_GET_ADDR_HIGH(&pshmem->linkstatus), > 0, 0); > #else > - status = slic_upr_request(adapter, SLIC_UPR_RLSR, > + slic_upr_request(adapter, SLIC_UPR_RLSR, > (u32) &pshmem->linkstatus, /* no 4GB wrap guaranteed */ > I imagine the request status should be handled, not ignored. So deleting 'status' seems like a step in the wrong direction. 0, 0, 0); > #endif > @@ -2087,8 +2083,6 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter, > adapter->error_interrupts++; > if (isr & ISR_RMISS) { > int count; > - int pre_count; > - int errors; > > struct slic_rcvqueue *rcvq = > &adapter->rcvqueue; > @@ -2097,8 +2091,6 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter, > > if (!rcvq->errors) > rcv_count = rcvq->count; > - pre_count = rcvq->count; > - errors = rcvq->errors; > > while (rcvq->count < SLIC_RCVQ_FILLTHRESH) { > count = slic_rcvqueue_fill(adapter); > -- > 1.7.10.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/