Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1931075rdb; Tue, 5 Sep 2023 09:07:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8T3gMWdHigT6rXQXA29iK7ubzcxwSfpQEETNK1pvWTVNLe69CXAenrJCKvS8TwavEP9ey X-Received: by 2002:aa7:d987:0:b0:52e:7e7b:b978 with SMTP id u7-20020aa7d987000000b0052e7e7bb978mr281450eds.18.1693930025555; Tue, 05 Sep 2023 09:07:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1693930025; cv=pass; d=google.com; s=arc-20160816; b=WQ57LeK79Y6g8h0r6HFBD4L1KCJsVBCt8AhKDl4hAGXQk8NCiXRhbuzwkGHMOsed5Q QoYiPsWty+Wd36w3Djc68qFdW4CJlkcIIZjheSyNfqCm5ZvMpkWkbz+wVueI8VNQ5FBX T90DRsfppHJxbn29EJVmbzqJRLXteeOmpgrWwjtuEFZefyXNLpd/I18a3pVbJwWx6gri qemW/D80DMUusBBQ93luusDCGIz+ebNhS88UdFzwVAaP+Tt/K0J5bT/bTUJChzgygP9z gaYJoa1SqYuv5qdQjCh+IMQcWh6HKE/2RkSKsRMHB9rHpUo+wdoyUevLWMmxhFFyogE1 k9Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=j0FJYR6GtUGAEadg2dpfOHIguqpQFVo7Nz1AHHxUwgY=; fh=v+XKXV851IU3LzqJHzC60o5XMyV/USP37Rl04VHgCAs=; b=s6eEo2IKK9RnnMu4FMLz4TMxAzjO+qPMp2LkeHZjBff6P5LW4venw8qZbk7J78r+Xz bDVnz4Rph+cjnEGJb8XlceVRHO0BZhbJd4NxyzKgkhTSHGooXDJvKEPIOj7mDCiWOp+6 EyR5LktP/jHRlGHAVX5ZOhp3+TfZKA+/xLJVsmHqKT0G9Ab3qJCOkd+UOaLnKL2GaVaw HNf/QGD08FtXmpNTnVz20DmNHa8LcZjMthSJKDxi9Yee4sLjpcHdVH8VY4sIU64JGLOW Jv2BZr7VQ0oaNZDqhctznL++k1G9dMB0cpzT+12gacFk7rOkd3Nk4dYVHUu/T2Bl/QM+ K+Mw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=dKGNzyzK; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2-20020aa7d782000000b005232618b016si7631651edq.208.2023.09.05.09.06.58; Tue, 05 Sep 2023 09:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=dKGNzyzK; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350493AbjIASDX (ORCPT + 10 others); Fri, 1 Sep 2023 14:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239031AbjIASDW (ORCPT ); Fri, 1 Sep 2023 14:03:22 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2010.outbound.protection.outlook.com [40.92.40.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DED4A1 for ; Fri, 1 Sep 2023 11:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqDrz3eFggw6AOAoyMp//Jt4wiYi0j627wvjTFCDfjOvwAIe9OtrRPE3KVKHgyFo2baGSh1OlMmofw2F2SBXNbTD7iXEzGJLH913SUA4jnY9zmbwp2INt6Ax6RXIbfxOsRJvwQZNQJmE5QSo1BAm46hiNM0cm+IiHekzS6fYME+1aprbjcfRASw8CV6pofW5im6mAL1AjkP8YsRz9CJiptqryZbfGWhhK3czqYs7R0rClqYbpSBzlGsFcR7TrvwRI0iNtZMafBYBTwD8CVbAAnAylCpxLatSxiXpg+vsqLHz0wsnuWj+KLbn7HkfufRfvoSWtV091iwzw7wSufgYtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j0FJYR6GtUGAEadg2dpfOHIguqpQFVo7Nz1AHHxUwgY=; b=ckF8z+GHJX1Xo4i10iGTnnfsyQuTSHle4SsmXEPbTroymjT0A6ImehGmMbqxDkUYaGChinjvbqV/jMAS86DNv+ndHD2pcb50EZGUCg+ALQCjiBKGl7/0ZlJDr1tn+7z+V6Ay4egfCsQjdY/QcDnZrk2Voeq2l505/ofsf4VgW+B6HLhf1Uvk/5IlovsEI4g0gFmCfg6lpI6Cgw2wnStZjEpGEA8gEWuNJf8WvELOh+zzbIh6m+boRXOe6r6uKRLNnhIeLshLevu4XNeATziQTSFstKKc8R7Xt0eSkcLgIASPU1x2fGC/RAAK4i4Qt/j/bpCVG8vkqOZmDREB7UWZ+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j0FJYR6GtUGAEadg2dpfOHIguqpQFVo7Nz1AHHxUwgY=; b=dKGNzyzK2lLHHa0gP0xGCWAYu5hRnk/IXt4JuIz14hPRm4twj+Mj4lWSeqGK3bkRC4wdh1JWqvoXEj+AmAlCivJCWoaPMO46HASsIQKc8F3wMOPrlr2lLtloovq3QoJqdd6ZLqyL3EhcSsRQmwlJl63cqjlaILEBFM3mF4hJsBuFXbiSNexl+OEwjlcpEVrw0mBnFWn/q4ySSCe8Yipwwg8BLNKxbu8J/vL2v+J8qlL56qNB+f01Vo+pLL/iTWzMc2N4avxXyn6wosgMw6VjUbCRyzW2Q00F4BrvL0BzhPirQCyoAdyrW01Z4x9PDtmxm5ab9tjHTtY4l/1Si+c4PA== Received: from CY5PR12MB6455.namprd12.prod.outlook.com (2603:10b6:930:35::10) by SN7PR12MB6957.namprd12.prod.outlook.com (2603:10b6:806:263::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.34; Fri, 1 Sep 2023 18:03:18 +0000 Received: from CY5PR12MB6455.namprd12.prod.outlook.com ([fe80::912:a56e:f6d2:86fa]) by CY5PR12MB6455.namprd12.prod.outlook.com ([fe80::912:a56e:f6d2:86fa%4]) with mapi id 15.20.6745.015; Fri, 1 Sep 2023 18:03:18 +0000 Message-ID: Date: Fri, 1 Sep 2023 23:33:06 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] powerpc/powernv: use appropiate error code Content-Language: en-US To: Christophe Leroy Cc: "gregkh@linuxfoundation.org" , Immad Mir , Michael Ellerman , Nicholas Piggin , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , open list References: From: Immad Mir In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TMN: [E+IBbG3kYOKcJbF9K4f/oHmO8TH9bVtlRF+zqrPumx6KdPM5BhR/Gm9BcnA+GPAQ] X-ClientProxiedBy: PN2PR01CA0023.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:25::28) To CY5PR12MB6455.namprd12.prod.outlook.com (2603:10b6:930:35::10) X-Microsoft-Original-Message-ID: <1706716d-a52d-e991-cb80-611039697f7e@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6455:EE_|SN7PR12MB6957:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b6e0aad-2ab5-4ad9-cbe3-08dbab15b882 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vD9Nb4stEFRZ4r64IHCzwIuk0R4lBL/GWKGMqH9iWi2j7CVgrKWrXjXo9y2XImi1b07MFzb5oLJW3iXeGBmDhHnLCdWQvB30U4T/KNwLGBJVLHygYmyzwvGFAnxx3Ioy3xYokoFuzjWmr4EL3aUgaCwtGXk5SmVF0KEyZKLimB7UF13JXlf1PraRHbRmZHYMCugWjxapoU3aqZrpE9uw4uxxFG3pUQA0bDBSNxTdcF1jB5gZomAea6MIaqV/WjSqXOACea1yfDrho0Q/LGQXj1VNp+aLV2tjIuPSByLKoQBj71bvyPMnD1Kowp++iyCbk/6aguJMYr37dG8BcToyzrU7OS1plm3o7RjkD2tEPUZeBR9TjsyNBPdln603v/YrcivWxqUlIDGZxSPBOhEJdPvx2Q72DJ3ykGwHps8m2bu2KGgAMruIDzm28KqbdTnvMfqVOWoFEaaKwjG6vKLnIuSumRNfFm6dEmKH1x+5VitkNCrBvWu5btbK00wMVfQP4oYd4hJ06TxgppjhANHMZ9wPBSvd7bX7Ng43GpPNB6Y+USFefWtAv6rshErYR37o X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Ex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message-Id: 7b6e0aad-2ab5-4ad9-cbe3-08dbab15b882 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6455.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2023 18:03:18.3581 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6957 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_MUA_MOZILLA, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/09/23 11:10 pm, Christophe Leroy wrote: > > Le 01/09/2023 à 19:19, mirimmad@outlook.com a écrit : >> [Vous ne recevez pas souvent de courriers de mirimmad@outlook.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] >> >> From: Immad Mir >> >> -1 is not a valid error code. This patch replaces it with -EPERM. > Can you explain how it will work ? > In scom_debug_init() rc is built by oring the value returned by > scom_debug_init_one(). > What will be the result when oring some valid values with -EPERM ? > It was working well with -1 because when you or -1 with anything you get > -1 as result. But with your change I don't think it will work. if EPERM is not always necessarily equal to 1, we can put a check in scom_debug_init before returning rc. If it is less than 1 (because AFAIK or-ring with negative number results back into the same negative number) we set rc equal to -1. Immad. > > Christophe > >> Signed-off-by: Immad Mir >> --- >> arch/powerpc/platforms/powernv/opal-xscom.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c >> index 262cd6fac..ce4b089dd 100644 >> --- a/arch/powerpc/platforms/powernv/opal-xscom.c >> +++ b/arch/powerpc/platforms/powernv/opal-xscom.c >> @@ -171,7 +171,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, >> if (IS_ERR(dir)) { >> kfree(ent->path.data); >> kfree(ent); >> - return -1; >> + return -EPERM; >> } >> >> debugfs_create_blob("devspec", 0400, dir, &ent->path); >> @@ -191,7 +191,7 @@ static int scom_debug_init(void) >> >> root = debugfs_create_dir("scom", arch_debugfs_dir); >> if (IS_ERR(root)) >> - return -1; >> + return -EPERM; >> >> rc = 0; >> for_each_node_with_property(dn, "scom-controller") { >> -- >> 2.40.0 >>