Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4227853pxb; Mon, 30 Aug 2021 23:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwSqTXH4ryzKF/iaNYuYld7pWvIOMnSh6EJ33tjiL92OsYIEpD8KOCc0ar0+0AjhhqfISd X-Received: by 2002:a92:c212:: with SMTP id j18mr18601956ilo.77.1630390668838; Mon, 30 Aug 2021 23:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630390668; cv=none; d=google.com; s=arc-20160816; b=HyxDn5/1Fo7jiE/vi/ehh6xztEGxKeXezaThWPPpMm93HdCZfIFaN5fQXBgoFdqJH7 uKECecXJ42qror5sWKqg09vxEM0AfsBUDsY428xpCBCtkpx4xQMzDHgWBPfIq6lUaxuA tuTPSpm4bZMpgYDCQCetLUDA+iCpsfTt1XS782mwY4Z9VlQAXPryKl5qWrUllnAZMbRt DAV3zneWVobG98yI174Zkrw8/vuo9aTAvR5NE8zE/S/80KsNuk3kyV3cX4RaOAvmxt9T 3IbiymbeoO+SuKYGv4v9ZdzfPw7lRtHtZ9DwpF/r70O5QW4Vv0IS++KffVeqedXSgivB OhWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=uLipEFd8kNOzLcifOAUEDmxkp7kk2e/f6vgLeAIed3U=; b=v4QJsM3NoqngsvQRTqiTNigKnNnpGtRVzEHbbgCKoSKPewose2IHy36ffOao8igEBu 0MzeufHF468SHFn1AVUTCJhDp9mODV2vfRts42lmWA8YBFc22CWdQ7s+m/oLdeyipn5Y tzpwSv6uBynRjcmHtt/KTuswTPWrEdpdkzc8ZlRbWio36LqgqTCcnLvfwm/D67ZANaCV 6L55vMxHC4/JGB6cBcXNK6Nvk3vEYzbYrtCg9X62hZZDrdKxtV0IjJmMhPjpmNcheQit SoTQd6g0qtftn3MtWUC9ag9TFbCh8eIxepLwmgZIULTAM0zkelfddzp3hJihnB5597tY W5Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YmMgVuTE; 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 b1si17290773ilj.117.2021.08.30.23.17.35; Mon, 30 Aug 2021 23:17:48 -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=YmMgVuTE; 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 S231995AbhHaGQw (ORCPT + 99 others); Tue, 31 Aug 2021 02:16:52 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:25768 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbhHaGQv (ORCPT ); Tue, 31 Aug 2021 02:16:51 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17V63qcE020813; Tue, 31 Aug 2021 02:15:56 -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=uLipEFd8kNOzLcifOAUEDmxkp7kk2e/f6vgLeAIed3U=; b=YmMgVuTEmR4gRB4hRwqZSphifNnbwHzRrI5U8cQvO49GZWzVi7KSijmwtVPbwUjU0Dhh JNzPaYX16z+AalqIl1XAff6bkoTQIm02gyak93LEn+F6k2VYNgx//md1oChgIcuDYaWj 3Rwj4bUd3fcLMX3R+kIxLx2nA+SzIShVWmrAQ6V5fYWW1JvE7D7vkJtbrumAQhmr3FId gXdTR7/YZv13cMEHaLf+AyKMY/XHgF0/gY+evcqMjKi+rdkQCN99JMvR9r3ylfa+AyZO YyXzZ/beGumxEwGlI8Wdf0987tPBNrpiI/EwvXJadU+FAKFVdTkwi1AVT6unrZgMcaAz YQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3asert0ffc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Aug 2021 02:15:56 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 17V64GLA022819; Tue, 31 Aug 2021 02:15:55 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 3asert0fen-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Aug 2021 02:15:55 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 17V6CvKd003209; Tue, 31 Aug 2021 06:15:53 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma05fra.de.ibm.com with ESMTP id 3aqcs8kg82-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Aug 2021 06:15:53 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 17V6Fnls20185352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Aug 2021 06:15:49 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AF2852145; Tue, 31 Aug 2021 06:15:49 +0000 (GMT) Received: from oc6887364776.ibm.com (unknown [9.145.184.25]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2640D52126; Tue, 31 Aug 2021 06:15:49 +0000 (GMT) Subject: Re: [PATCH linux-next] s390:fix Coccinelle warnings To: Heiko Carstens , jing yangyang Cc: Vasily Gorbik , Christian Borntraeger , Jiapeng Zhong , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, jing yangyang , Zeal Robot References: <20210820025159.11914-1-jing.yangyang@zte.com.cn> From: Vineeth Vijayan Message-ID: Date: Tue, 31 Aug 2021 08:15:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0TcdjAuOb1buvV6CJ_tF7iPMJEhhyMP9 X-Proofpoint-GUID: DxL2Wx0LVWL8F3zNVLDYLNFpGJprc1RA X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-31_03:2021-08-30,2021-08-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 malwarescore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108310035 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I am a fan of Coccinelle fixes. But, here i think we need to do more work than just fixing it to get rid of the warnings. I agree with Heiko. May be we should re-write this entire function and make it readable. Nack. On 8/23/21 8:07 PM, Heiko Carstens wrote: > On Thu, Aug 19, 2021 at 07:51:59PM -0700, jing yangyang wrote: >> WARNING !A || A && B is equivalent to !A || B >> >> This issue was detected with the help of Coccinelle. >> >> Reported-by: Zeal Robot >> Signed-off-by: jing yangyang >> --- >> arch/s390/include/asm/scsw.h | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/arch/s390/include/asm/scsw.h b/arch/s390/include/asm/scsw.h >> index a7c3ccf..754122d 100644 >> --- a/arch/s390/include/asm/scsw.h >> +++ b/arch/s390/include/asm/scsw.h >> @@ -691,9 +691,8 @@ static inline int scsw_tm_is_valid_pno(union scsw *scsw) >> { >> return (scsw->tm.fctl != 0) && >> (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) && >> - (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) || >> - ((scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) && >> - (scsw->tm.actl & SCSW_ACTL_SUSPENDED))); >> + (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) || >> + (scsw->tm.actl & SCSW_ACTL_SUSPENDED)); > This turns something unreadable into something else which is > unreadable. It's up to Vineeth to decide what to do with this. > > However I'd prefer if this would be changed into something readable, > maybe as addon patch, like e.g.: > > static inline bool scsw_tm_is_valid_pno(union scsw *scsw) > { > if (scsw->tm.fctl == 0) > return false; > if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND)) > return false; > if (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS)) > return false; > if (scsw->tm.actl & SCSW_ACTL_SUSPENDED) > return false; > return true; > } > > Chances are that the above is wrong... it's just to illustrate ;)