From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFC42C432BE for ; Wed, 11 Aug 2021 12:29:55 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01B1660FC4 for ; Wed, 11 Aug 2021 12:29:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 01B1660FC4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8DE1382DAD; Wed, 11 Aug 2021 14:29:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1628684964; bh=veAacbJfHW9Rayqyvq6ejwJ0xRZ8UXBsM1N1RX3KL24=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QXqESwAIWLwdNwD5IZt7tjjk4zqdwO0y7+vQIFyoSlqGpWVw1WgGwRXth+jMySvSv 5bhuTVOgVB6qfCRwhqGe25seSuv4GmBY+TYzX7n9YsC+6LP6TCOejvFj8wsCGz4N9O /mgNKYVvWMU6VN+3i8UXouLNd5l1pPNeMoQhL39raWCZY/pb7n0cSFkRb756e7AEPF 4Pvhx5Vn/vhgBSZEEdUEFAB2TSdouH3PiliasAGA2SGLJ4OlJgSl+8pIgyXKl7h0wt yICLcKYjin87BiiqS0rmHPDgBKLhblZLdYYtt0lqh13lDru0fbwy52xcbumZkusPkW xylnYxBm7wiPg== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 480C482DAD for ; Wed, 11 Aug 2021 14:29:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1628684963; bh=veAacbJfHW9Rayqyvq6ejwJ0xRZ8UXBsM1N1RX3KL24=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=loqnTcRFnM0R92V4DrqJeEgsTHNxgg876G8+Gv6UKY4qu8X9Q3vkKAxPsLPAc4L8f e1x/3pAwQTIv9/RyuvLIEm5oRlPVdYPs5owJwO2+MJ5YPx5bq2vgc9m3yZlvQ6+QYg hT/N0vu6bDoYLnaPmrSKjYfkJCbwxjGMpqF8zXPm1J71UUrTd006/L9hXfMdoR1u8l Ly51IFGkcze2u1FIGBIlRQ8KKaOYARnKsf/2EDwOkEXvjpG+iRHaFxuffphZ+WX9fC N8wCcQpcJeqvAsmnSBYpRPMbv9NukS3ig2nHXLRdrMpjUyolu01dqqhviWK9eLGwZ7 bVTqN9SbH8Z9g== Received: by janitor.denx.de (Postfix, from userid 108) id D3CE0A0228; Wed, 11 Aug 2021 14:29:22 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 16199A00A2; Wed, 11 Aug 2021 14:29:13 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id B7ED01E2304; Wed, 11 Aug 2021 14:29:12 +0200 (CEST) To: Rasmus Villemoes cc: Stefan Roese , u-boot@lists.denx.de, Simon Glass , Tom Rini From: Wolfgang Denk Subject: Re: [PATCH v4 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset() MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <3d48015a-07d3-e296-b9ba-a1edd455ce9e@prevas.dk> References: <20210802150016.588750-1-rasmus.villemoes@prevas.dk> <20210802150016.588750-8-rasmus.villemoes@prevas.dk> <024904e9-2205-37d9-e480-04de75c8cb5c@denx.de> <3d48015a-07d3-e296-b9ba-a1edd455ce9e@prevas.dk> Comments: In-reply-to Rasmus Villemoes message dated "Wed, 11 Aug 2021 14:13:07 +0200." Date: Wed, 11 Aug 2021 14:29:12 +0200 Message-ID: <538195.1628684952@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Dear Rasmus, In message <3d48015a-07d3-e296-b9ba-a1edd455ce9e@prevas.dk> you wrote: > > >> +       if (ret) { > >> +               log_debug("Error getting UCLASS_WDT: %d\n", ret); > > > > Perhaps log_err()? > > No, we've already been over this in earlier discussions (it's the exact > same pattern and reasoning as initr_watchdog). If I made it log_err(), > it would cost .text for something that never-ever happens in practice, > while log_debug() is usually a no-op, but can be compiled in if > something truly fishy seems to be going on. This argument fits on all types or effors: they are supposed to never ever happen - at least in theory; in reality they do, and more often than we like. And a proper error message is mandatory for correct error handling. > > Looks good, thanks for quickly working on this. Not sure, if this new > > function should be "void" or better "int" so that the error can be > > returned. > > That's why I included my tentative commit log, so you could see my > explanation for why I made it void. Until some user shows up that > _wants_ a return value, there's no point making it return int. When that > user shows up, we can discuss which int (return early on failure? > remember that an error was seen but still call wdt_stop on remaining > devices? etc. etc.). Returning an error code is always a good ide, no matter if current users check it or not. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de To the systems programmer, users and applications serve only to provide a test load.