From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbcF2JIv (ORCPT ); Wed, 29 Jun 2016 05:08:51 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35691 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751427AbcF2JH5 (ORCPT ); Wed, 29 Jun 2016 05:07:57 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: stewart@linux.vnet.ibm.com From: Stewart Smith To: Suraj Jitindar Singh , linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au Cc: robh@kernel.org, arnd@arndb.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, paulus@samba.org, sjitindarsingh@gmail.com Subject: Re: [PATCH V5 2/3] powerpc/opal: Add inline function to get rc from an ASYNC_COMP opal_msg In-Reply-To: <1467171519-19882-2-git-send-email-sjitindarsingh@gmail.com> References: <1467171519-19882-1-git-send-email-sjitindarsingh@gmail.com> <1467171519-19882-2-git-send-email-sjitindarsingh@gmail.com> User-Agent: Notmuch/0.21+24~gbceb651 (http://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu) Date: Wed, 29 Jun 2016 19:07:09 +1000 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062909-0004-0000-0000-00000FCBE80D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062909-0005-0000-0000-0000769D6AD4 Message-Id: <87shvw1hz6.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-29_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606290086 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Suraj Jitindar Singh writes: > --- a/arch/powerpc/include/asm/opal.h > +++ b/arch/powerpc/include/asm/opal.h > @@ -276,6 +276,14 @@ extern int opal_error_code(int rc); > > ssize_t opal_msglog_copy(char *to, loff_t pos, size_t count); > > +static inline int opal_get_async_rc(struct opal_msg msg) > +{ > + if (msg.msg_type != OPAL_MSG_ASYNC_COMP) > + return OPAL_PARAMETER; Should instead be WARN_ON or BUG_ON ? Is there *ever* a situation where calling opal_get_async_rc on a non-OPAL_MSG_ASYNC_COMP is a not both a dumb idea and a bug? otherwise (including if above change is made) Acked-by: Stewart Smith -- Stewart Smith OPAL Architect, IBM.