Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3213938imu; Wed, 7 Nov 2018 06:55:55 -0800 (PST) X-Google-Smtp-Source: AJdET5cKNLerhyyRhAh1aLyovyI0NUp34mVYF5PduroOevflMMIs0HOQ/7mmbb0tm2ZjZRHNTHV6 X-Received: by 2002:a63:ac02:: with SMTP id v2-v6mr451443pge.414.1541602555325; Wed, 07 Nov 2018 06:55:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541602555; cv=none; d=google.com; s=arc-20160816; b=etZWA7PKerVV9JVlzS4JbrA3QgMr1xnZqon/Cr//1NBGqZj3hlQAgXKCFDVsT5xG5z 04YFuQvYNYshSjb+5dnmnNIt2lbG3KXJM9JqLX2JI/C6vm0W9/XIodeAl+8h9uoT0MOC EtCHofQGNLcE/A/Qe7lvvPmY1RrC7AhdC5K/vA4HFjTelt39c783mgAwCHTXhk9417yI c3raZNyeLLmiZLp75r6VltR1ha1j38Y+GIa/KFQ+FnRjo9kvxd98o7/uNKiusj/K+N/y bolrM9JpPS0nSPRU+xVLvaZyhnW6uIAyWMfydSvvhfSjj3Clv2SXSGJK3o3E7DsscqpS nEkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=L51Xt0giWLtqlH6i1s69vwVGY1Yo0BoONXTZaii8naQ=; b=iJwDZ3sSqre3nV8FYEnh2kTKsKxNBuXW0g4lME9bwryFcJzlzNAt1AT9B6aRj5EqLp VK1LuJgQIwjT0d7z/TZpS8lkQMz7LMhSP7z8BeTjKPqV3zh4c28e4NU5a8JyaJgNvVzd JcMDEtHRrT9QtmKZDzIwsOyF29r6YXRzQx2BBZTzl0MyiU+cKEEnjUaVIOVhR92YotER kt8+sbSdu7+uFU4H8VNhJ5kFn+Ida4mTcFi62s+l84YY1HRQLIkyALdGqUqrh2WHLrXr qLLX3sUsgPXA7ZiCPcL/HXnXl5+5DXuJxV2wZ7RpQdJT9Wh63IxdN2kNld1JCSqx5Jwj apww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F4HZOM8S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5-v6si799710pfg.225.2018.11.07.06.55.39; Wed, 07 Nov 2018 06:55:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F4HZOM8S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731032AbeKHAZ7 (ORCPT + 99 others); Wed, 7 Nov 2018 19:25:59 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39607 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727265AbeKHAZ6 (ORCPT ); Wed, 7 Nov 2018 19:25:58 -0500 Received: by mail-pl1-f195.google.com with SMTP id b5-v6so7968933pla.6; Wed, 07 Nov 2018 06:55:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=L51Xt0giWLtqlH6i1s69vwVGY1Yo0BoONXTZaii8naQ=; b=F4HZOM8S4btK3nvPf4Mq9sUCWpHzc5nNuyOVw6X5eOnW/1jK72o3w418tYX/NCxn1w 9abOLsgHb7V7cHsN3qebOU+nlMGVab0oV46O/QV09SPsttvfGE4b5s8itzNHTtaBo+xP dzNK84voCXzs8gwzXy/Dz9hbtUsMj9j24SHwEf3D957HFRnYtTdyaXF7Z6EiSIN2/3IH zAKq6g9pEJ9+d4LmDa1sasljke+D0bdh6HD9y7Wwf5xRZV3rMrdrgMrmGceY82I7xV8h aYAN4Y2accIKEHLwkxwyP0EdoK8uvY/U2dAXD760U315jWKVMjkQgGxngoYtvcjHcQBZ ss1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=L51Xt0giWLtqlH6i1s69vwVGY1Yo0BoONXTZaii8naQ=; b=tfpETF+HJMwc1jUFYcr1dDxS2I/Ishg7WOYniW0Rkgr5yQXrhlXSal8vYRgiYFAs4o CE9PChYDD8I68Z/orCkjYQneRC9nXmYwaS84RDeoF8bwk8UNwzVijzwqaHxiQ3pPT8ht rrxDdKNxY7eqOI1JFX81wXc6q9Okg7d9OSpA0YhsJexaB3TbhkmOTRMKA/S6F12TIvEH a9jQSXr6xOXBcXZKbAhfPAD0wbcuPfXgQtUn4mMpa33+zvksM9IFRMhw6b3RjJ7oMEZQ 6srdyTQDE0hnIDuCwzzbsNreMqfsuwa3cviJltqVffwyKKpHldHGx/8Mgw67ZVGEl5D6 /VBg== X-Gm-Message-State: AGRZ1gJtUoRQRaHDObIR2AwC6SLbywbswW0dyfarYyQTxHLR+or6qKPN faF1o58ZYFC9MNN+5gfobeU= X-Received: by 2002:a17:902:bccc:: with SMTP id o12-v6mr524258pls.281.1541602517389; Wed, 07 Nov 2018 06:55:17 -0800 (PST) Received: from [192.168.1.70] (c-24-6-192-50.hsd1.ca.comcast.net. [24.6.192.50]) by smtp.gmail.com with ESMTPSA id f10-v6sm754782pgp.72.2018.11.07.06.55.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 06:55:16 -0800 (PST) Subject: Re: [PATCH v6 07/18] of: dynamic: change type of of_{at,de}tach_node() to void To: Michael Ellerman , Rob Herring , Pantelis Antoniou , Benjamin Herrenschmidt , Paul Mackerras , Alan Tull , Moritz Fischer Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-fpga@vger.kernel.org References: <1541431515-25197-1-git-send-email-frowand.list@gmail.com> <1541431515-25197-8-git-send-email-frowand.list@gmail.com> <87tvktqedf.fsf@concordia.ellerman.id.au> From: Frank Rowand Message-ID: <6bc78502-7587-eb9c-237f-d3f031979d42@gmail.com> Date: Wed, 7 Nov 2018 06:55:14 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <87tvktqedf.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/18 4:08 AM, Michael Ellerman wrote: > frowand.list@gmail.com writes: > >> From: Frank Rowand >> >> of_attach_node() and of_detach_node() always return zero, so >> their return value is meaningless. > > But should they always return zero? > > At least __of_attach_node_sysfs() can fail in several ways. Sigh. And of_reconfig_notify() can fail. And at one point in the history the return value of of_reconfig_notify() was returned by of_attach_node() if of_reconfig_notify() failed. > And there's also this in __of_detach_node() which should probably be > returning an error: > > if (WARN_ON(of_node_check_flag(np, OF_DETACHED))) > return; > > > Seems to me we should instead be fixing these to propagate errors, > rather than hiding them? The history of how of_attach_node() stopped propagating errors is a bit more complex than I want to dig into at the moment. So I'll drop this patch from the series and add investigating this onto my todo list. I suspect that the result of investigating will be that error return values should not be ignored in of_attach_node() and of_detach_node(), but should instead be propagated to the callers, as you suggest. -Frank > > cheers >