Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp747681pxb; Tue, 5 Apr 2022 21:34:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDNLuxPsv//kBodhAPVwpN/PVFub8MlfO6Dr0ynMLypyAl84H/d/qg1xm5WGO3df0ZgniX X-Received: by 2002:a63:c50:0:b0:381:5118:62d6 with SMTP id 16-20020a630c50000000b00381511862d6mr5590475pgm.420.1649219661425; Tue, 05 Apr 2022 21:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649219661; cv=none; d=google.com; s=arc-20160816; b=fS3cxJDr/ARTto6gnKThbdxQoDmO5pFsUKLP/r5gYgYCz2TE2oHoZJxxGW3clzrHiC yccZFJZMCi8hIyIt7xxBEtLIqRBASUR7P2tlZGTlkViavYcKHCr1P77DsXHlNB9ShZ12 gnBODItHHhDl7vPM2lBBviiM0m6b8tqKPV/26Pkly3vx5nMCqme6b2+r6Ap+G2CLqtuA TFwduf2Svo68z4I3cNbRKGZiYc2mHe9/xW2raH5+bJh+sHqe7BGGEs71B8ZSDoBymUj/ uSyftGjRbjQTZtREcNNRFauXo9ojbg82V+QVBt5B2WEdPczsjiObrVZPewmolSTj2zUR dHZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xAPSksevALtNR4PC0SvoG2WKxHfmcQ1JVmes6UfbRRI=; b=JsEwNLUtVaS7s/qNX7l+WFypRpVLpVT8eqvUl6v5U3Ukp7KV55/OwT5d19tt4ufyHK FyVb4b8OoWDT7ooJruXlKX09Op3ytow7OOVTp9bLTKtC773uXru++qEe+SN5fdx/3xNe nQdLhRdAdG6sXV/C5wy6giBsw++BdbkQZpP04EJSVcHcDMg5wPQRo4AnemuixVRuUFGk SOhqE37At/us1TU4OzrlwxKRrCnQB0b2+Y32/lZ/bjh+SP0O7aSw64nHYhIn3STg2bW+ LGyeOMVEqcRfQ51yDo62U/5eOAVUMrv5bx7eQAD0fIlg0G2HBI+++bOAQBLzQbnbaCbJ aERg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NYwbQ+n1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a2-20020a17090a740200b001ca8947e749si3870682pjg.20.2022.04.05.21.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NYwbQ+n1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BD2C28CAA2; Tue, 5 Apr 2022 20:03:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359139AbiDENKJ (ORCPT + 99 others); Tue, 5 Apr 2022 09:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344187AbiDEJSg (ORCPT ); Tue, 5 Apr 2022 05:18:36 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D23D76663E; Tue, 5 Apr 2022 02:05:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 4355DCE1C6C; Tue, 5 Apr 2022 09:05:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 629E8C385A0; Tue, 5 Apr 2022 09:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149505; bh=eI/tG81nC1saJgPatTgG7icD/lGlD5gWAo+K+jBtukE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NYwbQ+n135CdF7gGZ8YINtciQmS7JB3mTvNmNDWUKDeqGJve+iXxmhRUUfc1wIbU7 sot8GE0QWAlogecUyJy4aSPHFxIMUuyvVduVloORvPgbCzq7nine2ewmEyBbdmHuNz UbynodvtsQGYgkWTMSki57YyJq7qemc3dVrhNUcw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , "David S. Miller" , Sasha Levin Subject: [PATCH 5.16 0739/1017] qlcnic: dcb: default to returning -EOPNOTSUPP Date: Tue, 5 Apr 2022 09:27:32 +0200 Message-Id: <20220405070416.200180255@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix [ Upstream commit 1521db37f0d42334a88e8ff28198a27d1ed5cd7b ] Clang static analysis reports this issue qlcnic_dcb.c:382:10: warning: Assigned value is garbage or undefined mbx_out = *val; ^ ~~~~ val is set in the qlcnic_dcb_query_hw_capability() wrapper. If there is no query_hw_capability op in dcp, success is returned without setting the val. For this and similar wrappers, return -EOPNOTSUPP. Fixes: 14d385b99059 ("qlcnic: dcb: Query adapter DCB capabilities.") Signed-off-by: Tom Rix Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h index 5d79ee4370bc..7519773eaca6 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h @@ -51,7 +51,7 @@ static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb) if (dcb && dcb->ops->get_hw_capability) return dcb->ops->get_hw_capability(dcb); - return 0; + return -EOPNOTSUPP; } static inline void qlcnic_dcb_free(struct qlcnic_dcb *dcb) @@ -65,7 +65,7 @@ static inline int qlcnic_dcb_attach(struct qlcnic_dcb *dcb) if (dcb && dcb->ops->attach) return dcb->ops->attach(dcb); - return 0; + return -EOPNOTSUPP; } static inline int @@ -74,7 +74,7 @@ qlcnic_dcb_query_hw_capability(struct qlcnic_dcb *dcb, char *buf) if (dcb && dcb->ops->query_hw_capability) return dcb->ops->query_hw_capability(dcb, buf); - return 0; + return -EOPNOTSUPP; } static inline void qlcnic_dcb_get_info(struct qlcnic_dcb *dcb) @@ -89,7 +89,7 @@ qlcnic_dcb_query_cee_param(struct qlcnic_dcb *dcb, char *buf, u8 type) if (dcb && dcb->ops->query_cee_param) return dcb->ops->query_cee_param(dcb, buf, type); - return 0; + return -EOPNOTSUPP; } static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb) @@ -97,7 +97,7 @@ static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb) if (dcb && dcb->ops->get_cee_cfg) return dcb->ops->get_cee_cfg(dcb); - return 0; + return -EOPNOTSUPP; } static inline void qlcnic_dcb_aen_handler(struct qlcnic_dcb *dcb, void *msg) -- 2.34.1