Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3077585rdg; Tue, 17 Oct 2023 04:07:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBFndfrfTSLi3C1htc40zg3w7ADYZl8k2TvGdWBrR7RKw4YbZmDWFHed66zFf3YcJUphI/ X-Received: by 2002:a17:902:eccd:b0:1ca:86b:7ed9 with SMTP id a13-20020a170902eccd00b001ca086b7ed9mr2187274plh.40.1697540843768; Tue, 17 Oct 2023 04:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697540843; cv=none; d=google.com; s=arc-20160816; b=UJznmktNbDylT+6sBMu46TlxEumiZKB1/yCwvZDJ8y5hH4BmYzxDQoK+cTmW5ybG8c dJ4rcCzSrDoxhlsymltQYFN+aHl1jBEDGSFga4okIQfRcXZM+fyvdZSnZ3ZGlx3/Y1NM fLcquW4Ivhucni3r3iCgBoTD3jCvtXpElIXqanwNzpy9S/bjaKWXBm9y7Cm3cSWzXFnf zmIJeK0HuNkW2fh1/iA/sQ2MDqWGY1/vXgHRRJc1dJABrQK/hJs/yaQEUR916PIKOp2x Ro3Cw4H14FAcO2CJFV1rm8BSxc5oUw4UFWwhxllkuUPeQaC9JtZEglsm7VaGOa5blJgv iwJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YJC4nFF3vhCV0/q49aZ8HDwgeodSnFveb4bvsgI4wfo=; fh=8AzSlaicoVd1KHbcG/seWKEDqSHpa5qGQhXcSicPgl0=; b=QiqWB+8MJDUStwb2IO47ZlcRlnmJmXJNfm5awsw2QmniFWiAfizMB94yCtqM0R4A6F PbTP72yufwoeLSN9XE/oeyybiQwFY7Y1lzz86oKq4SEK2xQIAAvNA416qexhwyWDFdRR mkWOIy1DHDTq6+cNIgO+IKs8N8mkOTVNlYrKvjA1nwbNhrUdkqBLQ51boGpEndBlZvoT q2hl2eWmhgyEd+SbLEx0kORBGI3YDhSltgoGRZtOY6KSd4edPHl7x2acBc3bMof9E+Cc CLfqswZvEUZr67HbL8/o4pmWRmzOX1v0EETKGFF4Zj6iCUJu/F+tN31DLCKpApt6cb01 TvKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=BcloNKLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id w7-20020a1709029a8700b001ca8f6b3b8fsi1422695plp.266.2023.10.17.04.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 04:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=BcloNKLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0CF60802EF5A; Tue, 17 Oct 2023 04:07:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234670AbjJQLHD (ORCPT + 99 others); Tue, 17 Oct 2023 07:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234674AbjJQLHB (ORCPT ); Tue, 17 Oct 2023 07:07:01 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9E2DFD for ; Tue, 17 Oct 2023 04:06:57 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53db1fbee70so9376569a12.2 for ; Tue, 17 Oct 2023 04:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1697540816; x=1698145616; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YJC4nFF3vhCV0/q49aZ8HDwgeodSnFveb4bvsgI4wfo=; b=BcloNKLWZcnf1n9iQN2f9fxQZkSgqF1QxsawOKBB/3pM8XgUS2d7tM++jLQAQK0hxv kt9r7XqUndatyhcndjGsVDLoMWproTXUeUpppgyQkeaoeSMqmuY7JBj5lPzB1gmEemvk JPrQl8FQ942tE8dwg/NxmhqzGzQySsoHdV4Md5vXQOBTKUBg7nwV/L4hzLUgg00UzQEP mzZD6Z8aFXvJ3TdPCTPS/UangRy1IDaousuorNZ8vMUdg/iAOTlpdKcHxHr52Yh3jBDc F7pq4ay3qP7wVrM9yhnyZAMqgz/KkFYbeoSlFY0XXqvFsc+bHOgMykjzUs5yYtwTeUEE dD8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697540816; x=1698145616; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YJC4nFF3vhCV0/q49aZ8HDwgeodSnFveb4bvsgI4wfo=; b=E85u7wei7EOakJFcra43MEpf43aU/pMvNJQ4z8/ffyQvgDpEHFOOEsqqymu84qmDAm EGijP7dmum5eUaj18PttK6vVCPhBVaMk+mjDe9bLyLkxRn7fuuiLKbNS+fwzAMevk3Sg rT3JLKtZ3C+1sUR6uqyLR8Ah8Qc7dZlDkD18tVQEn/odTdSMQmIuMi/dFuF5vMmiSkV6 WtCx0QX2/JlOpvgyf/35aybz1319taCuQtl4r4cYO5QmMxNjPb9vfho1AOXUSrJmyV2W p+rTO5sdag+38NwjijYDqdhjCkA1qaigIarKnwStZKD1sa6fkAOs7g+6rb/X5MsQmvDe jhEQ== X-Gm-Message-State: AOJu0Yx8s7rZJeSpWddcu3C9CYLP57ubib6HLX7t6J/SeL8tomRJMHSs P1xD+N3d4gHpGMmaVSRFL6SUJQ== X-Received: by 2002:a50:ab55:0:b0:52e:1d58:a6ff with SMTP id t21-20020a50ab55000000b0052e1d58a6ffmr1212905edc.35.1697540815909; Tue, 17 Oct 2023 04:06:55 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id v15-20020a50954f000000b0053120f313cbsm1043876eda.39.2023.10.17.04.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 04:06:55 -0700 (PDT) Date: Tue, 17 Oct 2023 13:06:54 +0200 From: Jiri Pirko To: Przemek Kitszel Cc: netdev@vger.kernel.org, "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shannon Nelson , Michael Chan , Cai Huoqing , George Cherian , Danielle Ratson , Moshe Shemesh , Saeed Mahameed , Ariel Elior , Manish Chopra , Igor Russkikh , Coiby Xu , Brett Creeley , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Ido Schimmel , Petr Machata , Eran Ben Elisha , Aya Levin , Leon Romanovsky , linux-kernel@vger.kernel.org, Jesse Brandeburg Subject: Re: [PATCH net-next v2 03/11] pds_core: devlink health: use retained error fmsg API Message-ID: References: <20231017105341.415466-1-przemyslaw.kitszel@intel.com> <20231017105341.415466-4-przemyslaw.kitszel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231017105341.415466-4-przemyslaw.kitszel@intel.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 04:07:19 -0700 (PDT) Tue, Oct 17, 2023 at 12:53:33PM CEST, przemyslaw.kitszel@intel.com wrote: >Drop unneeded error checking. > >devlink_fmsg_*() family of functions is now retaining errors, >so there is no need to check for them after each call. > >Reviewed-by: Jesse Brandeburg >Signed-off-by: Przemek Kitszel >--- >add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-57 (-57) >--- > drivers/net/ethernet/amd/pds_core/devlink.c | 29 ++++++--------------- > 1 file changed, 8 insertions(+), 21 deletions(-) > >diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c >index d9607033bbf2..8b2b9e0d59f3 100644 >--- a/drivers/net/ethernet/amd/pds_core/devlink.c >+++ b/drivers/net/ethernet/amd/pds_core/devlink.c >@@ -154,33 +154,20 @@ int pdsc_fw_reporter_diagnose(struct devlink_health_reporter *reporter, > struct netlink_ext_ack *extack) > { > struct pdsc *pdsc = devlink_health_reporter_priv(reporter); >- int err; > > mutex_lock(&pdsc->config_lock); >- > if (test_bit(PDSC_S_FW_DEAD, &pdsc->state)) >- err = devlink_fmsg_string_pair_put(fmsg, "Status", "dead"); >+ devlink_fmsg_string_pair_put(fmsg, "Status", "dead"); > else if (!pdsc_is_fw_good(pdsc)) >- err = devlink_fmsg_string_pair_put(fmsg, "Status", "unhealthy"); >+ devlink_fmsg_string_pair_put(fmsg, "Status", "unhealthy"); > else >- err = devlink_fmsg_string_pair_put(fmsg, "Status", "healthy"); >- >+ devlink_fmsg_string_pair_put(fmsg, "Status", "healthy"); > mutex_unlock(&pdsc->config_lock); > >- if (err) >- return err; >- >- err = devlink_fmsg_u32_pair_put(fmsg, "State", >- pdsc->fw_status & >- ~PDS_CORE_FW_STS_F_GENERATION); >- if (err) >- return err; >- >- err = devlink_fmsg_u32_pair_put(fmsg, "Generation", >- pdsc->fw_generation >> 4); >- if (err) >- return err; >+ devlink_fmsg_u32_pair_put(fmsg, "State", >+ pdsc->fw_status & ~PDS_CORE_FW_STS_F_GENERATION); >+ devlink_fmsg_u32_pair_put(fmsg, "Generation", pdsc->fw_generation >> 4); >+ devlink_fmsg_u32_pair_put(fmsg, "Recoveries", pdsc->fw_recoveries); > >- return devlink_fmsg_u32_pair_put(fmsg, "Recoveries", >- pdsc->fw_recoveries); >+ return 0; Could you please covert the function to return void? Please make sure to do this in the rest of the patchset as well. Thanks! pw-bot: cr > } >-- >2.40.1 >