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.7 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 F323EC4338F for ; Thu, 12 Aug 2021 06:40:34 +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 0BF1B60FD7 for ; Thu, 12 Aug 2021 06:40:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0BF1B60FD7 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 1A24B82BD7; Thu, 12 Aug 2021 08:40:31 +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=1628750431; bh=rRC0J+9lHubmnS4aStkuz+nEdzVVyDWqxtwgOTGTw1M=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ibhQBWimfeZvJMITSI6RHt7xsGlKaQEQinc4E3+n+ykJMJ3w7VLcfDJyo6gR7gWcZ 99CrxcxJ90am61w/UUkftbWGM/A/NopIZF/GmC/QniHx72O6UG2KBWILZcJgmCi9yT 1jIL0FLI1auyuOTu/iIiSJ4WbdaTH7iECZdWNM/HjZeyuk8UCpW+bRn7PURlOtf+Rz EPQ/EaD5ZT8i1KIkqsu8ZI9TKe5Lv/PpheIB+v2QORM0JpluSFyhSsvyeGJeDUlYnI xqpI12kgRSOQHePp6uu+CD69VIpozUqjcWkMX3GxEVsy1OMR6bnwcv7bj+wcg9QSvA Hjt+02877fkCw== 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 7491882000 for ; Thu, 12 Aug 2021 08:40:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1628750429; bh=rRC0J+9lHubmnS4aStkuz+nEdzVVyDWqxtwgOTGTw1M=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=FEobheuCIbLY4kHRCm9xUVdhooVSN5ixvkWBc9geHh7+I1++NemUnlpvz8JQn5Uvd TwRksmdPkkXR+BIUvmPu7I4mZZFyQL+Kk1vXjwSByfVi1cj2QnVhaKbmhKMNHhn0Kq CoTIkS3GLlLa+s0lDM58xfmyImK8+VT/v/NiPXqv3Zm4fAtsXmHPbbBiuZfgiNAY2A o6avuI42pPe0HjDUnsoqCG/dEPldioCO74xohDhmfnsYSOWn4tDnN47Iv1eHir2fqo aKvkZpD0rlMWT5zaGKN02Resbp1MqDkx14voQ7vJ3553IaZ18/pue8x0oNCuk7vjaB w4nPTATu7DHjw== Received: by janitor.denx.de (Postfix, from userid 108) id 10319A0069; Thu, 12 Aug 2021 08:40:29 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 5A9EBA005F; Thu, 12 Aug 2021 08:40:21 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 4AC501E2304; Thu, 12 Aug 2021 08:40:21 +0200 (CEST) To: Tom Rini cc: Rasmus Villemoes , Stefan Roese , u-boot@lists.denx.de, Simon Glass 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: <20210811124318.GT858@bill-the-cat> 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> <538195.1628684952@gemini.denx.de> <20210811124318.GT858@bill-the-cat> Comments: In-reply-to Tom Rini message dated "Wed, 11 Aug 2021 08:43:18 -0400." Date: Thu, 12 Aug 2021 08:40:21 +0200 Message-ID: <575632.1628750421@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 Tom, In message <20210811124318.GT858@bill-the-cat> you wrote: > > > 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. > > Error messages are a fine line to walk. We've got to have been very > badly corrupted to go down this error path. There's going to be lots of > other error messages popping out. Saving a bit of .text is good. It > makes it easier to justify spending a little .text later. Letting errors slip through unnoticed when there is a trival way to at least inform the user of the problem is simply unacceptable. Please do not let U-Boot degrade into such a crappy piece of code. There are tons of other places where we don't even mention code size, so if you want to save on that, there are many bette4r places to save than error handling. > And here I agree, catch an error code, pass the error code back to the > caller. That's far more important than making sure that every error > code we catch logs a message by default every time. It does not matter where the error is reported - in the called function, or in some caller firther up the call tree. But it _must_ be reportet at least once. So if we don't issue an error message here, we need to check and fix the callers, too. 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 If programming was easy, they wouldn't need something as complicated as a human being to do it, now would they? - L. Wall & R. L. Schwartz, _Programming Perl_