[PATCH] staging: slicoss: slicoss: Removed variables that is never used

David Matlack dmatlack at google.com
Wed Feb 11 20:36:25 UTC 2015


On Sat, Jan 31, 2015 at 7:13 AM, Rickard Strandqvist
<rickard_strandqvist at spectrumdigital.se> 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 <rickard_strandqvist at spectrumdigital.se>
> ---
>  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 at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


More information about the devel mailing list