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 C706FC32771 for ; Thu, 9 Jan 2020 09:16:25 +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 8103820673 for ; Thu, 9 Jan 2020 09:16:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nZMZFoAo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cnRPew3X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8103820673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=eEpuQGdpJTkiVogHV/yUuG15/dAwAvCq1CDLc/q10cI=; b=nZMZFoAoIJaUtL jotY0VO4uLjOe2C36ZfSTIfFmldeB2B8VqoYecYRaS/7W5k+b4l7hKJ6tG9jT38bk/184Zjddl5le arQfabk6o0dudRkU5Dse+n4QD3Imm3JJv0Iouf5MuwNU4KTQpjWGamHuCBpLxDT8NsD2Dwp2J9kF0 iCqp5vyTE0pCvNf+NqhhDjjuEFnFohuQCJxqKmhYD9CzY5PmU0O4IEjbcM4xOoUMjh4W6fWxIeijK LS5jmtqbKU6IvGw9WB4eLu+CeK6H6/Znu5ZDyh/6AzHS2aAakwaXw4Qz2hW37v4NOZQChCDuw2pc8 QguOBFclIzoA5Ne76E1Q==; 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 1ipTvU-0001cE-JP; Thu, 09 Jan 2020 09:16:24 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipTvP-0001ZD-Cy for linux-arm-kernel@lists.infradead.org; Thu, 09 Jan 2020 09:16:21 +0000 Received: by mail-pg1-x544.google.com with SMTP id z124so2913725pgb.13 for ; Thu, 09 Jan 2020 01:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LhceEG3UhA0whwHt1MK3h6+cCL04vTq3JH/shOvFsrQ=; b=cnRPew3XWiPXqcRGiN7BEZsnaW0ivBrmTgYDkqDwMIeibcDlESn0xD67dJ7Hz+B8y+ Smxe57Zyi9Paz8ABIUBUPcZkV+fqootaT1SgxRAGR7NzM+lty6dI7lmFmSwu6lBJYYdA FAHgr/YMtOObVtFEzer6wvXdAcDDBNuPOv8rQGXTRVinSSkKt1nQ961Hg38bz3dMbb7c KYCXcXghI9+Nq3YDK5cyhpY8fcFaN4SexwEgSfXWhZEs96Hynh/iI6NJow+ahStMfaB+ mMiSPeWKHUgoU37yccqkGn7+iR8Ii1KKBK2fgpsTPGcVyjKcQ6CJGnJAgs8gRiF3E2SK N1Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LhceEG3UhA0whwHt1MK3h6+cCL04vTq3JH/shOvFsrQ=; b=Vl3R5/fIv0cd0/dkgYhNvShagpYjHicoErYOFm5QE3c4vi7ALCaNM+CuTzJDWmzkJq ZpQMzhpZEeaTTlgt20KNvsMIWPpeDUYF5Wpi+ZePMgf6xq0qc8IH8oZfs1eggKn0QOBj EQ9KZcPc5YNJXAQzSPJFVMixLEHnHaYMMh1lfDQnJ1IxTrXQ7+aVWpo8qJyBlw8Uw47N 3UEQE9yu1G3I89MMI7Edxhm/ltem5LN8ijZVwn//CQZAX7TXw85UXT0MRDQa9efmzfyf 3FD5X52egxRBCknz5LoYk9/1XeKmfNkrq2Nnx8xsIlk/pWQqM83edwFYQJNFV3+MJZJ9 InZQ== X-Gm-Message-State: APjAAAUwV4XcD5JJ7gn6Th/Ms4+3Zd6CopQ8io7jO2MleCxUpo/3PKlE 0EdFmQfOxiGPTRMal98+zuVf5w== X-Google-Smtp-Source: APXvYqwVlE2aRDWxTdxtk/WQvDtvsNKnq/FDp4We/vNa60vMihisUPjSivxC/byqI4W23qZOZe+56Q== X-Received: by 2002:a65:4c82:: with SMTP id m2mr9844041pgt.432.1578561376259; Thu, 09 Jan 2020 01:16:16 -0800 (PST) Received: from localhost ([122.172.140.51]) by smtp.gmail.com with ESMTPSA id j94sm2335952pje.8.2020.01.09.01.16.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jan 2020 01:16:15 -0800 (PST) Date: Thu, 9 Jan 2020 14:46:13 +0530 From: Viresh Kumar To: Arnd Bergmann Subject: Re: [PATCH] firmware: arm_scmi: Make scmi core independent of transport type Message-ID: <20200109091613.fx2ggmmjvgjempks@vireshk-i7> References: <5c545c2866ba075ddb44907940a1dae1d823b8a1.1575019719.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200109_011619_438892_72036F40 X-CRM114-Status: GOOD ( 13.84 ) 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: Jassi Brar , "linux-kernel@vger.kernel.org" , Linux ARM , Sudeep Holla 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 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() ? -- viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel