Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp966243pxy; Wed, 5 May 2021 19:33:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzliv51O9H4riVpGXNLqyYFntnzIlXvw43lHwjQ1UIeZUJw4Cb+7KR7gnxvS5+pVAm9C4G3 X-Received: by 2002:a17:906:7209:: with SMTP id m9mr1891635ejk.223.1620268422761; Wed, 05 May 2021 19:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620268422; cv=none; d=google.com; s=arc-20160816; b=xJ0poHxArgDWuUQyOjEPph/tMAvDXbJl9+oJe3oYokT7PvM0tkQcYSQ/a8QlJ2ZSCG Q5xWGyE7wpOhWdsd08494Bnkhl56RlS4Lb9v8a2ZP3zkEdkhjBJf4NuEpNYH/dQY1rjy AYks6jDP0byJmKHXsL6u/4gY+G5kjfD4s2zW3Q8l0ubGmO+wp4GtEDRDEO/9iCTIbsEr /9FYIO5GyphURrS5wQuXAD1nV0+UwVTEuVlVSw/oYRttEmi52qQAAQ5L2JMhDmlKWR/o I/QDlzOQxV7FxcjVBu00hSyOK3mstPMrPfo6Rse31hrLRi7p7co02koaqMbjAw5j71HL PTkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=zVJIP4Vr3vYoks5fNrjKys6fTQaLjWRrc40xCBL/L1A=; b=YLfuEe5QB8EE5fO3zh/IrWUSZXcrt8ocUy2xGoRzJHugq1ahC/3ANpK2tXmUbCzFfb 9F6HMJ6lX1YWThTSg9nsHPYg1V8k8OktIQE6wKlfBITRbV9Trxsex2Nze5uYbhgI0I1q hicqB2evgu19soP3/OsbJDNVEe74tWgrcXcM/HB1msggDB88AiVN2Wm9t72808tEuy5B 5kHWws/VogZWf6EjG8htBD8BmcsVDrzkZWjwtHtUCmPkOZy0naxjBr4rWzDAojeZwADd /dRzCOnOiCIEpDoMxomQh0LUXpamkpwxjBoO+7MKFiuaZhCB/W7VSMHFHUxlI+1iw9pY 324w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=j6pI8n7z; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h25si1060035eds.368.2021.05.05.19.33.19; Wed, 05 May 2021 19:33:42 -0700 (PDT) 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=@ibm.com header.s=pp1 header.b=j6pI8n7z; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231648AbhEFCb1 (ORCPT + 99 others); Wed, 5 May 2021 22:31:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40364 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231370AbhEFCb0 (ORCPT ); Wed, 5 May 2021 22:31:26 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14623PuL099470; Wed, 5 May 2021 22:30:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=zVJIP4Vr3vYoks5fNrjKys6fTQaLjWRrc40xCBL/L1A=; b=j6pI8n7zzIhv2A9GYDh49psG9zlPAmU/bIfUFv0NcJr+okNT0qumI43NLX41VjDVse3D MWsgYsWyQu7ONrCvmuhb5Pvia/1rsGFyCJlYb829SYPkMStDabuu/UjJF7UpfqftBhJZ htSZxK4oXpyuj/SJlnGgkjlaq7+p8xl+W+xx9JHhptpWUo85FpsjNs3Ms/p+djNj0YI6 PsQLbEQyXzcOlfrkG48rNAktXa3r/apwvN+Z5PDWk0oAA2EGt9tZG7nhZpC84GIpUm5f oDnRLsm1IfvPANXcVC9R8iYVhjPt4pus9hSfuWV8lyLoZJBrx9b4t1mkbuHUteI5jiqz Jw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 38c69asqvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 22:30:14 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 14623NMj099371; Wed, 5 May 2021 22:30:14 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com with ESMTP id 38c69asqv2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 22:30:14 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1462Qr2F020795; Thu, 6 May 2021 02:30:12 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 38bee88axx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 May 2021 02:30:12 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1462U9Av57410018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 May 2021 02:30:09 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 498D05205F; Thu, 6 May 2021 02:30:09 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id E93C752059; Thu, 6 May 2021 02:30:08 +0000 (GMT) Received: from [9.102.44.218] (unknown [9.102.44.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 10924605DB; Thu, 6 May 2021 12:30:03 +1000 (AEST) Subject: Re: [PATCH] cxl: Fix an error message To: Christophe JAILLET , fbarrat@linux.ibm.com, arnd@arndb.de, gregkh@linuxfoundation.org, mpe@ellerman.id.au, imunsie@au1.ibm.com, mikey@neuling.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: From: Andrew Donnellan Message-ID: <2d898a2a-fc3c-a804-ce13-cbfc58565cfb@linux.ibm.com> Date: Thu, 6 May 2021 12:29:57 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: VSghf0rnEQ14vYNIMtTSdUOwaviH6ala X-Proofpoint-GUID: E86YZwJNrf2pBY55GnvTwxdXP9pAeMwV X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_11:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1011 phishscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105060012 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/5/21 5:38 am, Christophe JAILLET wrote: > 'rc' is known to be 0 here. > Initialize 'rc' with the expected error code before using it. I would prefer: "In cxl_add_chardev(), if the call to device_create() fails, we print the error message before 'rc' is set correctly, and therefore always print 0. Move the error message after setting 'rc'." > > While at it, avoid the affectation of 'rc' in a 'if' to make things more > obvious and linux style. I strongly agree with this, some of the other cxl developers don't but they are wrong :) > > Fixes: f204e0b8ce ("cxl: Driver code for powernv PCIe based cards for userspace access") > Signed-off-by: Christophe JAILLET Apart from my comment above: Acked-by: Andrew Donnellan Thanks for catching this! -- Andrew Donnellan OzLabs, ADL Canberra ajd@linux.ibm.com IBM Australia Limited