Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp222690pxb; Mon, 8 Nov 2021 12:32:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBqiHTpSt0mBkEL2drGh7xS1gm3INLb5U+U7WdDLitsn9Ln7RT7c4HxCyb8rjjc/kbUiAo X-Received: by 2002:a92:d411:: with SMTP id q17mr1321228ilm.116.1636403532122; Mon, 08 Nov 2021 12:32:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636403532; cv=none; d=google.com; s=arc-20160816; b=iMkeX0ZOu8NGonA1iQFac5a+cRPWTz2CdHLWSTxrJdgPKD8xVAGlDhcPlThdVYZ6Pf NfljyVdRnf21r1RhDZimw3ndgbhlp1sbbrry3JpnRP7uDQ+V2MZzRTcZLBzuJhglqAcG hb0YviTKZQXJQqIqiHUBbbmx92wgfEp+E9y89uDjNkZc+lA5Yw8lIgB27LIiPHSgToWK 5mECiTFCqg+P6KFQlKESiqGkV6mqS1nlqbVkJ3bHhxXNdg7H0EpCHiZBUT6Wz5Y7sRsk jDWKEUyRicYtgU+gdstBzBG9P93T/aNXHmrbmZPg5Qgth4dzYovxxJq10jGp9XtQduFc mZ4A== 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=BmhP/O36y2kgWhY9wVesOsCT3VZHRN0l2HSALpf1H38=; b=QGQQZND4Or8/QQ2tdmUeJhQEf1ewt3rNtoG93asrvyv91ahY5qjzvSOeNy4FlQZQwM AxoTCjYFSYDtvW6M4l2Xp4+s/VmJHe0HgCqTyWjW9Kx4+nx/qwcQMqlOmSkd9X6xJdkB DLg1eu0QJyZo0sYWX0/U3iOHUsh6RRWE4M8J3Q0f/RWQYN2oLjIVbljxUfyQc9Tl+RMk kq2arf5it5MDk4a6jALyx4wwwax46SXf7KwRaRE1gKv6RBsAQI6P6cqKrB2JUH9E9t/3 mOgPLFJJcPaW4HnILjllypSC1dd2s7DSEko+UJ0mg5YObNVyi1ZkPd484cgmipJgJiLC b3kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="PwrrR1/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si37360133iow.31.2021.11.08.12.31.58; Mon, 08 Nov 2021 12:32:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="PwrrR1/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241214AbhKHQYk (ORCPT + 99 others); Mon, 8 Nov 2021 11:24:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239990AbhKHQYh (ORCPT ); Mon, 8 Nov 2021 11:24:37 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A331C061570; Mon, 8 Nov 2021 08:21:52 -0800 (PST) Received: from zn.tnic (p200300ec2f331100181cb4ce2fe9e1de.dip0.t-ipconnect.de [IPv6:2003:ec:2f33:1100:181c:b4ce:2fe9:e1de]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 071501EC0503; Mon, 8 Nov 2021 17:21:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636388511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=BmhP/O36y2kgWhY9wVesOsCT3VZHRN0l2HSALpf1H38=; b=PwrrR1/9r0PtkEkx8l94Lq5o8cthN3NxILevAwj1LoIRoN/B58W84rM+iyPPtwIBmVMRtG 8jlUd2DAmGqQe7+sK0xny6az8RzdndQG0jeU2pdwyReIQXuaywQhQg+JKE/uRG6ku5v9jN K5y81X7+5Pp2iJVW5AZDozV+KOdqQTY= Date: Mon, 8 Nov 2021 17:21:45 +0100 From: Borislav Petkov To: Geert Uytterhoeven Cc: LKML , Thomas Gleixner , Arnd Bergmann , Ayush Sawal , Greg Kroah-Hartman , Rohit Maheshwari , Steven Rostedt , Vinay Kumar Yadav , ALSA Development Mailing List , bcm-kernel-feedback-list , Intel Graphics Development , intel-gvt-dev@lists.freedesktop.org, alpha , Linux ARM , linux-clk , Linux Crypto Mailing List , linux-edac@vger.kernel.org, Linux Fbdev development list , linux-hyperv@vger.kernel.org, linux-iio@vger.kernel.org, linux-leds , "open list:BROADCOM NVRAM DRIVER" , Parisc List , Linux PM list , linuxppc-dev , "open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM" , Linux-Renesas , linux-s390 , scsi , Linux-sh list , linux-staging@lists.linux.dev, linux-tegra , linux-um , USB list , "open list:TENSILICA XTENSA PORT (xtensa)" , netdev , openipmi-developer@lists.sourceforge.net, rcu@vger.kernel.org, sparclinux , the arch/x86 maintainers , xen-devel@lists.xenproject.org Subject: Re: [PATCH v0 42/42] notifier: Return an error when callback is already registered Message-ID: References: <20211108101157.15189-1-bp@alien8.de> <20211108101157.15189-43-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 08, 2021 at 05:12:16PM +0100, Geert Uytterhoeven wrote: > Returning void is the other extreme ;-) > > There are 3 levels (ignoring BUG_ON()/panic () inside the callee): > 1. Return void: no one can check success or failure, > 2. Return an error code: up to the caller to decide, > 3. Return a __must_check error code: every caller must check. > > I'm in favor of 2, as there are several places where it cannot fail. Makes sense to me. I'll do that in the next iteration. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette