From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92B86C33CA2 for ; Fri, 10 Jan 2020 12:22:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6370C2077C for ; Fri, 10 Jan 2020 12:22:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="R4yE9/BV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6370C2077C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PTq2wgQ8uV6g6C3eKotY6l4Z4D+bzQyt0/fhdTJfuh4=; b=R4yE9/BVvKMYTk OUb9xpdnWL7K8OJdFEaMy61aJhda3G7PpJOKmag739dnnkMuEqghVWr2pneOgzEwT6vqYZg/FlGi7 JtX5wtgiHf4/0Aq/ahkTehhPY8q1b0sobM1hEXLoAoOtmH78HutBWBrRcY3eEPCXV48hHv7UZO7KN DZfA68KTmQswtZeIMKWhlBQiDcS/XSNBcZuCpixowpcl5DXTRPWq22C8gCm4pfFsrrmwUkQI+yqzq A21OKPBeCmGkQ+0LxYuwVkTR/4YZ+VSssAGqQi/vZgwuFmNf/D9QZB9iZFGz8BQVwHypXtrqjcl66 UlEFAcBPhMqlX/lp4u9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iptJF-0005kD-3a; Fri, 10 Jan 2020 12:22:37 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iptJC-0005iz-OE for linux-arm-kernel@lists.infradead.org; Fri, 10 Jan 2020 12:22:36 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A8A951063; Fri, 10 Jan 2020 04:22:33 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A5AB23F534; Fri, 10 Jan 2020 04:22:32 -0800 (PST) Date: Fri, 10 Jan 2020 12:22:26 +0000 From: Sudeep Holla To: Viresh Kumar Subject: Re: [PATCH] firmware: arm_scmi: Make scmi core independent of transport type Message-ID: <20200110122226.GA45077@bogus> References: <5c545c2866ba075ddb44907940a1dae1d823b8a1.1575019719.git.viresh.kumar@linaro.org> <20200109091613.fx2ggmmjvgjempks@vireshk-i7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200109091613.fx2ggmmjvgjempks@vireshk-i7> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200110_042234_833338_D9EB341E X-CRM114-Status: GOOD ( 16.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Jassi Brar , "linux-kernel@vger.kernel.org" , Sudeep Holla , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 09, 2020 at 02:46:13PM +0530, Viresh Kumar wrote: > On 09-01-20, 09:18, Arnd Bergmann wrote: > > > +static int mailbox_chan_free(int id, void *p, void *data) > > > +{ > > > + struct scmi_chan_info *cinfo = p; > > > + struct scmi_mailbox *smbox = cinfo->transport_info; > > > + > > > + if (!IS_ERR_OR_NULL(smbox->chan)) { > > > + mbox_free_channel(smbox->chan); > > > + cinfo->transport_info = NULL; > > > + smbox->chan = NULL; > > > + smbox->cinfo = NULL; > > > + } > > > > There is something wrong if smbox->chan can be be one of > > three things (a valid pointer, a NULL pointer, or an error value). > > > > I see this is a preexisting problem, but please add a patch to > > make it consistently use either NULL pointers or error codes > > and remove all instances of IS_ERR_OR_NULL() from this > > subsystem. > > This isn't a subsystem problem actually. mbox_request_channel() never > returns NULL on error. > > @Sudeep, do we really need the IS_ERR_OR_NULL() check in > scmi_mbox_free_channel() helper ? Or can it just be IS_ERR() ? > It can be just IS_ERR, just not noticed it so far I believe. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel