Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp303896ybi; Thu, 1 Aug 2019 19:27:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTSaKoXFjR9uOt7hjhLkUno2jKGvruRLXyzq20wdfrEmrLANJ9rJl0o21VfZKSgtjvIcZN X-Received: by 2002:a17:90a:26ef:: with SMTP id m102mr1908730pje.50.1564712857015; Thu, 01 Aug 2019 19:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564712857; cv=none; d=google.com; s=arc-20160816; b=iBAlf6Tva2a8YKLDueQf68YrB1bnXjbl5A6qM7zT11momzx5n/S5gSyxLuwT/7u7by sEdAtL7CkkwFFgIR4WUnqkoVXXxTMJ0kjEqN56jFYP2LhS4xKTqFGS4eVV9UCIjqFgL5 tz64yOyMhdPz38MEbiFa+AkNrWW6OnkZZVH3HJbANmwEtWwSBGVsbFu5lSxZoYBxRRTx 7vkFjIoQTlR3aLhDe6q5RV2N97S7lruBlILoLbLRAVjikoA/3FjwuT6RY5A5VJ7QPKQy 7X00O5np2eI/WsshasIEknOm3pvEO9jzsJvxTkXuek9nMdMDVScVx4Rjj1JhFoj/EeVW h6Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:date:subject:cc:to:from; bh=7a1A6KTWH848aQ1MzrgGPKqYqIb6vPwS45vF+0k9ZhY=; b=PX51fQp0oZYUtQME7bksxXW8E3uaOzvzSBR68xuMp7EQf69QIqdrgouautmH/Wu58H tdvpiaQ4GNgT7+26PuYdcoC6J6R4PgSEiSQ3q4Ahd7QfMsryhYnL5fLZ/HVaW0zue35I dMyM2QQ0YYXrd5Gpa0z7nPFAgOw+QEgK8qO1mN4ds+FiBiH6NBUX/e+0yTT1pXz8XQdW cLkXqtMWuhV0s/hkkG/PN4HvLXAPONLLTTkkcCyAW+xfSxhgfb0/28FCzusZB+MMWDd4 A/VumyYPyLb3zxX0qYc+NT4VoAb5Q66duIr9nD0lPG6iYXnJ6kFSlXninbYYlx/E6hka 56Ww== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si5540122pjn.27.2019.08.01.19.27.22; Thu, 01 Aug 2019 19:27:37 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732067AbfHAXLM (ORCPT + 99 others); Thu, 1 Aug 2019 19:11:12 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:8208 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfHAXLM (ORCPT ); Thu, 1 Aug 2019 19:11:12 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x71N7o6Y027340 for ; Thu, 1 Aug 2019 19:11:11 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u48wn924m-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 01 Aug 2019 19:11:10 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Aug 2019 00:11:10 +0100 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 2 Aug 2019 00:11:06 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x71NB5nl44826960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Aug 2019 23:11:05 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1857BC606E; Thu, 1 Aug 2019 23:11:05 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4CE5AC6073; Thu, 1 Aug 2019 23:11:02 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.147]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 1 Aug 2019 23:11:01 +0000 (GMT) From: Leonardo Bras To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Leonardo Bras , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , David Hildenbrand , Greg Kroah-Hartman , "Rafael J. Wysocki" , Nathan Fontenot , YueHaibing , Thomas Gleixner , Mahesh Salgaonkar , Rob Herring Subject: [PATCH 1/1] pseries/hotplug-memory.c: Change rc variable to bool Date: Thu, 1 Aug 2019 20:10:55 -0300 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19080123-0016-0000-0000-000009D75B29 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011535; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01240745; UDB=6.00654301; IPR=6.01022169; MB=3.00028000; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-01 23:11:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19080123-0017-0000-0000-000044429749 Message-Id: <20190801231055.19603-1-leonardo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-01_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=791 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010244 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes the return variable to bool (as the return value) and avoids doing a ternary operation before returning. Also, since rc will always be true, there is no need to do rc &= bool, as (true && X) will result in X. Signed-off-by: Leonardo Bras --- arch/powerpc/platforms/pseries/hotplug-memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 8e700390f3d6..392deb4855e5 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -338,7 +338,7 @@ static int pseries_remove_mem_node(struct device_node *np) static bool lmb_is_removable(struct drmem_lmb *lmb) { int i, scns_per_block; - int rc = 1; + bool rc = true; unsigned long pfn, block_sz; u64 phys_addr; @@ -363,11 +363,11 @@ static bool lmb_is_removable(struct drmem_lmb *lmb) if (!pfn_present(pfn)) continue; - rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION); + rc = is_mem_section_removable(pfn, PAGES_PER_SECTION); phys_addr += MIN_MEMORY_BLOCK_SIZE; } - return rc ? true : false; + return rc; } static int dlpar_add_lmb(struct drmem_lmb *); -- 2.20.1