From patchwork Fri Dec 16 01:24:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9477187 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC70960827 for ; Fri, 16 Dec 2016 01:24:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B820F28876 for ; Fri, 16 Dec 2016 01:24:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACD22288A9; Fri, 16 Dec 2016 01:24:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D64BC28876 for ; Fri, 16 Dec 2016 01:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758243AbcLPBYM (ORCPT ); Thu, 15 Dec 2016 20:24:12 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:50175 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757282AbcLPBYD (ORCPT ); Thu, 15 Dec 2016 20:24:03 -0500 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 0027E20BA6; Fri, 16 Dec 2016 02:23:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1481851425; bh=oKAYUzrmYq5MsB6UbOGAhT1c0sXWiZB/Zs2HPCYZtsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BkNpjiizxg9LhJAofHLuKM3MK7qaC4QW7JulHSAYHy2c0vkp1unQPV1GTJOinINza pxnhtoXyCNMw0fbuzPQPPwZScwXXi0PjLWhpYzBshZqD5/LedWlrOhrIpzeqEpgeeH RNwAt0WaUouxsp/pP0OvNjn8eEmLo1A+5gau1TkY= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, Pawel Osciak , Marek Szyprowski , Kyungmin Park , Hans Verkuil , Sumit Semwal , Rob Clark , Daniel Vetter , Laura Abbott , Sakari Ailus Subject: [RFC v2 08/11] vb2: dma-contig: Don't warn on failure in obtaining scatterlist Date: Fri, 16 Dec 2016 03:24:22 +0200 Message-Id: <20161216012425.11179-9-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161216012425.11179-1-laurent.pinchart+renesas@ideasonboard.com> References: <20161216012425.11179-1-laurent.pinchart+renesas@ideasonboard.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sakari Ailus vb2_dc_get_base_sgt() which obtains the scatterlist already prints information on why the scatterlist could not be obtained. Also, remove the useless warning of a failed kmalloc(). Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 2a00d12ffee2..d59f107f0457 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -370,10 +370,8 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) struct sg_table *sgt; sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); - if (!sgt) { - dev_err(buf->dev, "failed to alloc sg table\n"); + if (!sgt) return NULL; - } ret = dma_get_sgtable_attrs(buf->dev, sgt, buf->cookie, buf->dma_addr, buf->size, buf->attrs); @@ -400,7 +398,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) if (!buf->dma_sgt) buf->dma_sgt = vb2_dc_get_base_sgt(buf); - if (WARN_ON(!buf->dma_sgt)) + if (!buf->dma_sgt) return NULL; dbuf = dma_buf_export(&exp_info);