From patchwork Fri Sep 11 11:50:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 7159891 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4ACE49F326 for ; Fri, 11 Sep 2015 11:52:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7995320841 for ; Fri, 11 Sep 2015 11:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE6D12085F for ; Fri, 11 Sep 2015 11:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752660AbbIKLwi (ORCPT ); Fri, 11 Sep 2015 07:52:38 -0400 Received: from mga14.intel.com ([192.55.52.115]:21344 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752493AbbIKLwa (ORCPT ); Fri, 11 Sep 2015 07:52:30 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 11 Sep 2015 04:52:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,511,1437462000"; d="scan'208";a="803050808" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga002.fm.intel.com with ESMTP; 11 Sep 2015 04:52:28 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id D3797211DD; Fri, 11 Sep 2015 14:52:24 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id BE86F201ED; Fri, 11 Sep 2015 14:50:47 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: pawel@osciak.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, hverkuil@xs4all.nl, sumit.semwal@linaro.org, robdclark@gmail.com, daniel.vetter@ffwll.ch, labbott@redhat.com Subject: [RFC RESEND 09/11] vb2: dma-contig: Don't warn on failure in obtaining scatterlist Date: Fri, 11 Sep 2015 14:50:32 +0300 Message-Id: <1441972234-8643-10-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.1.0.231.g7484e3b In-Reply-To: <1441972234-8643-1-git-send-email-sakari.ailus@linux.intel.com> References: <1441972234-8643-1-git-send-email-sakari.ailus@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 3260392..65bc687 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -88,10 +88,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(buf->dev, sgt, buf->vaddr, buf->dma_addr, buf->size); @@ -411,7 +409,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);