Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1384878rdg; Fri, 13 Oct 2023 23:12:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXSMnBWTWU26HInw8OkvgqSySqjZvZjiK3dEv7vaEWze9o/kzM9deHnKJ+23OdtpfhbF6W X-Received: by 2002:a05:6870:4d03:b0:1e9:c1e0:5a97 with SMTP id pn3-20020a0568704d0300b001e9c1e05a97mr6511326oab.13.1697263957893; Fri, 13 Oct 2023 23:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697263957; cv=none; d=google.com; s=arc-20160816; b=BJF/mzZpUCayXFl5ukkcXvoxhrF7xplf7nrmtEgaoxDv/DX1UPVCiInAlyISD6vRoM QBlZJCRfZh07cPN3D//SgNBo4tzF7sTR9agNY9GwmK4KFEKGEOj+ITbYoL0ZNcTDFWwU UasFWUzaOeyiGBvqgCdkIO9kVkH1VpTtJBtvlVORwYtntnMQVdzlewFsgkUWAcmK6nyB udajxGVPQ8MUvEcnJAWjphjD5r2Qc888n1W7YVJptRdhA+jc8T1UXnnEjU9weniDKm37 1W1QSuz/gdT1v8BsqK3fnlANYRU50Q3ZGJDiRKgmaLfVdMmhqwguOH2yBVF4pAfdxAkQ Zytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=1VRzvbjqCINI1PjThGRzgdXHNyyoQH94qlPK9c4W3jg=; fh=zn6bbGNhzQ+nWB/2t4X9j9vd+oQDUJjKo1NvBdQYq68=; b=udXd58fNkjP6OUMvn7Jki6V2ow4dE64vzhVsBBtqBeCaYz6CGh5UR7dhmv3UFEd2ds 0fbg7exPHC41Lgo4Zhmi1OVicDGsUXyVujykeLisoRDJIO45ZxuEb4aviil7fx4iAvpH cVkFLnoHbG3cwXbtXfrPANfGW/sJg6VrZyIB0QyH9YnyLQtL29Id7sURhFOf/pbXFXoB ar5qmW4R6ZQEjPKjxKdmC5bNgzNaBQlSgq85Cwl9opDGm8ijZSnaeo3yP8zYKyszB8lc yC5m3j1fhp1jSUgildjUUIaLCBMSlH1erGJuz+HKWDSXMk/grWZlV+eoPC1ta08aN3Mx XyAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=j3H1hIW8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 12-20020a63184c000000b00585a6bdce46si2713283pgy.308.2023.10.13.23.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 23:12:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=j3H1hIW8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BFCC882F09B7; Fri, 13 Oct 2023 23:12:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232799AbjJNGMN (ORCPT + 99 others); Sat, 14 Oct 2023 02:12:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232717AbjJNGMK (ORCPT ); Sat, 14 Oct 2023 02:12:10 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD1D6C2; Fri, 13 Oct 2023 23:12:08 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3231df054c4so2272847f8f.0; Fri, 13 Oct 2023 23:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697263927; x=1697868727; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=1VRzvbjqCINI1PjThGRzgdXHNyyoQH94qlPK9c4W3jg=; b=j3H1hIW8s0mX6xMYgzqOsXGQOYG+bJxJoM2q5WCRVoknhFsUnjzMIZiM7UjVnKbU8c zIR9NtjP4sRyxjV2xsboGqdOifv8F/B2FFJrjMXbzEISp1jME7F1QSPvTTQFQNnuztT/ 9VDFj9jT4YqUjVu09cttoW7cVeIhkpiBrbAbyIndeenD4BtTL5zHl96nk/++YfcVtOxZ TW47qFcLi1Jc4IwAJQT/ieYjOfk0U9FASCfVlM/V3RrvdXu3VuVMReg4XsPSjTI5eh0C GL6HHIGtHm1O6aErQoQkz9yE66pK+YGAdgFVkGLOCHyV9mDYceq8Y5D0l+hUCqsBqVEo wUow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697263927; x=1697868727; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1VRzvbjqCINI1PjThGRzgdXHNyyoQH94qlPK9c4W3jg=; b=B8xlvMjTHEyLVaAlKih4RKliDXhXEDlJHx9elaWsYSQ9I9BkYmrj4VnMe4M7utYjQG /CbdRDrOuTgVJicsUdGO6IRscgHyQjhtqWCB5YkKJnTbXCH72V3zaGhHzqdvVT0DsFaN ahs4llaYa37ucf7Yi0dvGIHME8dsIEcJP9nN75y6uVNNIxswz4HZuzzCKSHbtdlIZO5H f1Y6q8X7mOV7dqbBxVjfDpXTyOPwgBm8NEGr+pkArLHZM1nBAjclPhoOqDq2ErTkF6Lv oIoNhoWatOwtamc7e7mD1a+AJj1XQ9bV8HcRL9WrUPnBtFCfGZdl6f4RD7K7IPRaqTXK +Org== X-Gm-Message-State: AOJu0YyzhL/Wf5MqYzekYp/xgsycBjwYyTQrlmOQhq+fQ2VeZ+0XqatJ 2E2aDoQLm+bNtJ9NgQWjAW4= X-Received: by 2002:a5d:63cb:0:b0:32d:a40f:d920 with SMTP id c11-20020a5d63cb000000b0032da40fd920mr901050wrw.20.1697263927045; Fri, 13 Oct 2023 23:12:07 -0700 (PDT) Received: from gilbert-PC ([105.112.18.68]) by smtp.gmail.com with ESMTPSA id k7-20020a5d66c7000000b0031fd849e797sm22116052wrw.105.2023.10.13.23.12.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 23:12:04 -0700 (PDT) Date: Sat, 14 Oct 2023 07:11:59 +0100 From: Gilbert Adikankwu To: outreachy@lists.linux.dev, manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, coiby.xu@gmail.com, gregkh@linuxfoundation.org Cc: netdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging: qlge: Add bool type to qlge_idc_wait() Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 23:12:35 -0700 (PDT) Reported by checkpatch: WARNING: else is not generally useful after a break or return The idea of the break statements in the if/else is so that the loop is exited immediately the value of status is changed. And returned immediately. For if/else conditionals, the block to be executed will always be one of the two. Introduce a bool type variable 's_sig' that evaluates to true when the value of status is changed within the if/else block. Signed-off-by: Gilbert Adikankwu --- drivers/staging/qlge/qlge.h | 1 + drivers/staging/qlge/qlge_mpi.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/qlge/qlge.h b/drivers/staging/qlge/qlge.h index d0dd659834ee..b846bca82571 100644 --- a/drivers/staging/qlge/qlge.h +++ b/drivers/staging/qlge/qlge.h @@ -11,6 +11,7 @@ #include #include #include +#include /* * General definitions... diff --git a/drivers/staging/qlge/qlge_mpi.c b/drivers/staging/qlge/qlge_mpi.c index 96a4de6d2b34..44cb879240a0 100644 --- a/drivers/staging/qlge/qlge_mpi.c +++ b/drivers/staging/qlge/qlge_mpi.c @@ -909,6 +909,7 @@ int qlge_mb_wol_set_magic(struct qlge_adapter *qdev, u32 enable_wol) static int qlge_idc_wait(struct qlge_adapter *qdev) { int status = -ETIMEDOUT; + bool s_sig = false; struct mbox_params *mbcp = &qdev->idc_mbc; long wait_time; @@ -934,14 +935,17 @@ static int qlge_idc_wait(struct qlge_adapter *qdev) } else if (mbcp->mbox_out[0] == AEN_IDC_CMPLT) { netif_err(qdev, drv, qdev->ndev, "IDC Success.\n"); status = 0; - break; + s_sig = true; } else { netif_err(qdev, drv, qdev->ndev, "IDC: Invalid State 0x%.04x.\n", mbcp->mbox_out[0]); status = -EIO; - break; + s_sig = true; } + + if (s_sig) + break; } return status; -- 2.34.1