Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3082150rdg; Tue, 17 Oct 2023 04:16:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHb41lfLrbPZGk/UTLiT+PbHuguMl2lTKlblKWw/jQrWHrh+IlVNScn7FkwOVCJculnhsAV X-Received: by 2002:a05:6808:cf:b0:3a7:6385:28ac with SMTP id t15-20020a05680800cf00b003a7638528acmr2081076oic.4.1697541380261; Tue, 17 Oct 2023 04:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697541380; cv=none; d=google.com; s=arc-20160816; b=UJSKUJ8GEWUxuBoPOFEKIPwpZU0NPTYNzcNul6yGh7wCRFwCEl4Fv/RuJo5QmFTzeG /sDIyvpjQDfUu5LT67wpTm7wrJ0U/HOMZuVTegTbUOWm7nRQMmMDEVX+CjjkjgsaDVzb /bnMOoftG1FDPnWAp3oBJgiMdNd22sFlJVdEAz+sUUnipFNz4nq9DjNOTj8n2+xAF2TO I0v0FJ4xhajQyPD85ieBDl/khEon4GXOORVA57t2OWF1Qg3lhxDk55rOhKCReiZwC67c 5/w1TbpbfQS7/DbswqBOCavC2Vd3/2CZuTLNDp0dAx5XbXNqkrlmGusJdtlTaUtHRPNt 2lYg== 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=AKh8Rphk+/QSFMLZeP3WthmhQMsK2wQ8t/XPNfZzXF0=; fh=8AzSlaicoVd1KHbcG/seWKEDqSHpa5qGQhXcSicPgl0=; b=ahNdkAl3oEF8cs5CvUum2dQvLsLH4EV7lXMZ7DQ+rS/JuOw0d3oQo315FES5t3LSQf O0iAshlZCRD4vRI0c9b2bH4LqRLTDQELNbVdFbBhmAIvPPINVG4v8gashHytwc+8vzm6 y3QJasK0+x10Davb4fXfo8bWWY8L6q7/8g733tog/lrHM61zVAqFahUkHD+nmhIt92+9 C4XEDf9c4mYRIjPAb3wlvTG0pesEc+UDwtvvt0uBGfHqQmovaUiCFmxB2LRgjXr21I+Y mnmCCEeB2CqlK/iEJvID4jwB4k0yqeCLlEzTpXL7D1n1OUZ5XqdzlQD0xBuSmlutuX16 fyzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=jtiC2PFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id r18-20020a638f52000000b00585ad175170si1584067pgn.69.2023.10.17.04.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 04:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=jtiC2PFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 443CD80D6E66; Tue, 17 Oct 2023 04:16:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234835AbjJQLQE (ORCPT + 99 others); Tue, 17 Oct 2023 07:16:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234819AbjJQLQC (ORCPT ); Tue, 17 Oct 2023 07:16:02 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5FBDF1 for ; Tue, 17 Oct 2023 04:16:00 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-53db1fbee70so9390087a12.2 for ; Tue, 17 Oct 2023 04:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1697541359; x=1698146159; 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=AKh8Rphk+/QSFMLZeP3WthmhQMsK2wQ8t/XPNfZzXF0=; b=jtiC2PFZ/ctlViRmzDIeYttICdRNZsk6xOq4Mo16v3piTbASgDoP93mslyXk1LRZn2 C+zzqDx6GYOgaumnnVu9XmiwrGjwDJJp7Ql6O4yImgtPSNIMbSCIWL3bbaHSMvbT90Tm Zs5Ps1cgYj3mEG0v7KLpDPfcTYVFD+FfRx8zNRzj6VCmOz2ii6IIke2E8QkJLCP3npJz ZNPE0005kvMvQtkSqO7q14tBDlEktgdcUsIoh/seCIaYrtrfIlhwZiiLQWsoKnx6qvA1 ywY+XsW1RLGb9ii04rtB/pyi5s/Huuj49RWshfwZpGE6dPUxIwYsx/YnWzH4igdA0QpR 7ueQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697541359; x=1698146159; 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=AKh8Rphk+/QSFMLZeP3WthmhQMsK2wQ8t/XPNfZzXF0=; b=DffqA3s03r2vjGnoTPHOhPT/2cCGfqgJy31LKh5nUFEO5drSATrWsAuuURFbWFWhb+ jlZbW2Ll3/N1O6ufP05N0NeZzZ7mbeUmuOMUaABTo5dupl5FovXMTkjatqYDJmFsbJ0v 6crfC6wir+P0HlyJACtoO76Wpw6lLmzsVTFycnCiLKZj+7oAvARwBxyehjJkVsPtFoWn blmRYcXsNyR6X0DYm8FTxUgImufYVy30lp4VrXamnK4WpGE+dEZ59LA9e6JEQgoPqhRj s9Ylco5l02bUyeMHeI0vutL7DZ2g3s1thxxn1FjFcOofCUxiowHrrD4+xRHWmcUctswM m/DA== X-Gm-Message-State: AOJu0Yz/L8iD+fIQ+4Tkk5nsRmrKUwjumzL9tS6nNzgxOfpjlCH6kg1e M9Btc8ADNFeXnNgY3DIXPIfqSA== X-Received: by 2002:aa7:d1c7:0:b0:53e:1815:ed0f with SMTP id g7-20020aa7d1c7000000b0053e1815ed0fmr1287255edp.31.1697541359166; Tue, 17 Oct 2023 04:15:59 -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 k21-20020aa7d8d5000000b0053e89721d4esm998411eds.68.2023.10.17.04.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 04:15:58 -0700 (PDT) Date: Tue, 17 Oct 2023 13:15:57 +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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 04:16:11 -0700 (PDT) Tue, Oct 17, 2023 at 01:06:54PM CEST, jiri@resnulli.us wrote: >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! Sorry, I messed up, this is a cb. Looks fine. pw-bot: under-review > >pw-bot: cr > > >> } >>-- >>2.40.1 >>