Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp59980pxb; Mon, 8 Nov 2021 09:43:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzstZHd1YLP7jzWaOoGEPRJizOJ4Gg7ZO3Ibsb6O+AiuuAHJbLATfdl2E6HCO4IcVGjZ5oV X-Received: by 2002:a5d:994f:: with SMTP id v15mr657951ios.88.1636393410393; Mon, 08 Nov 2021 09:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636393410; cv=none; d=google.com; s=arc-20160816; b=eHvdHsSUQimmXIMEqXTiJtPpWYnAV+eGZsAkXmob6giLL1K6rPJ+lk+aFwVTwr6rXv SH4nd3c5utjxd3X2jSYd9ecjIGpCBBuFuisVLZWD0dJaJexzn8kVTdZCrya2+tOtvbb8 GKCPq+NoAf3ZrsHBtk8zYwEPS9e04A2pZgROL2Wdc1pwJlmIqLKq0eD8/4X5jip9aLof mR3hMT4SRCZmmcuuBDbRbqksb5rteL6ZpoqXwPUrF875WZQbtzkPLAcdn+5abH59KAnr lFta8TW4VIbDRpGkvmLl0RA2tOCUk2hqU2er+sXtWy6XraoY9jco2VMCljof0UlF79Wz yqpw== 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=JALJsenIQCt4BletZS/B+Zq0YBxBp6L9Ch45cvOw8XQ=; b=LqSs59RVQxMKMsXWdL4CKeT8hCasY1GuZV5EOJeKV/W31t17v0On956Egxsv86OCpi CK9yspbtfFlIodlw7Lk4vCX7WXEtgU6ZRI9jPxLI92YPk1q8uBfZcO92LfVX1K5UOcD8 FZe5iUVTL2xMd1ZXNFJLxOxOTD2pbtQz+8E3CkWdEc+HZRb1t6ZTxduOpxkOIytwZoAo r9GG+bP597gyT6kXy5YRIMUlFs6RAlEJjukT389P2ymFedsZRgc9vmFQHhJCvV0UHTED 2R9b7OVksFKWrq6KKNosTBlUKu98PXuksQHDsSV0W0pVOZsYzheahx13iR+e7UFfVmCa 924Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LCBDSZEh; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 h27si853036jav.6.2021.11.08.09.43.13; Mon, 08 Nov 2021 09:43:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=LCBDSZEh; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S241126AbhKHQBy (ORCPT + 99 others); Mon, 8 Nov 2021 11:01:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236850AbhKHQBy (ORCPT ); Mon, 8 Nov 2021 11:01:54 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA6DC061570; Mon, 8 Nov 2021 07:59:09 -0800 (PST) Received: from zn.tnic (p200300ec2f331100b486bab6e60d7aaf.dip0.t-ipconnect.de [IPv6:2003:ec:2f33:1100:b486:bab6:e60d:7aaf]) (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 341131EC04DE; Mon, 8 Nov 2021 16:59:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636387148; 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=JALJsenIQCt4BletZS/B+Zq0YBxBp6L9Ch45cvOw8XQ=; b=LCBDSZEhct23FIVquhfAlhIS3MpLXm84rotG+ppp99dGMPWi9iJHGgKkfiFg0DoLQ+NSWf ixY2Bl+WafqAknd6kFkKb4q9SvLPR/pI4iyCTMD6S/zki4CWzqH6/1ZBq8awazUNWt4Xi0 idSLz3mdlao9wfI9n1SzGKhLH2sR0dI= Date: Mon, 8 Nov 2021 16:58:57 +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-crypto@vger.kernel.org On Mon, Nov 08, 2021 at 04:25:47PM +0100, Geert Uytterhoeven wrote: > I'm not against returning proper errors codes. I'm against forcing > callers to check things that cannot fail and to add individual error > printing to each and every caller. If you're against checking things at the callers, then the registration function should be void. IOW, those APIs are not optimally designed atm. > Note that in other areas, we are moving in the other direction, > to a centralized printing of error messages, cfr. e.g. commit > 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to > platform_get_irq*()"). Yes, thus my other idea to add a lower level __notifier_chain_register() to do the checking. I'll see if I can convert those notifier registration functions to return void, in the process. But let's see what the others think first. Thanks for taking the time. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette