From patchwork Tue Mar 10 09:37:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 5975871 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D8AE6BF440 for ; Tue, 10 Mar 2015 09:37:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A2BA200FE for ; Tue, 10 Mar 2015 09:37:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06113200F3 for ; Tue, 10 Mar 2015 09:37:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751188AbbCJJhd (ORCPT ); Tue, 10 Mar 2015 05:37:33 -0400 Received: from mga01.intel.com ([192.55.52.88]:24162 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbbCJJhb (ORCPT ); Tue, 10 Mar 2015 05:37:31 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 10 Mar 2015 02:37:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,373,1422950400"; d="scan'208";a="662991445" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.156]) by orsmga001.jf.intel.com with ESMTP; 10 Mar 2015 02:37:30 -0700 From: Jarkko Nikula To: dmaengine@vger.kernel.org Cc: Vinod Koul , Viresh Kumar , Andy Shevchenko , Jarkko Nikula Subject: [PATCHv2 2/2] dmaengine: dw: Make error prints unique. Part #2 Date: Tue, 10 Mar 2015 11:37:24 +0200 Message-Id: <1425980244-22005-2-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1425980244-22005-1-git-send-email-jarkko.nikula@linux.intel.com> References: <1425980244-22005-1-git-send-email-jarkko.nikula@linux.intel.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@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 The same error message is printed from different switch cases. Since both of these jump into same error label we can move error print there and add a DMA direction in order to make it easier to grep error from sources. Signed-off-by: Jarkko Nikula --- drivers/dma/dw/core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 29cbd8989c95..1022c2e1a2b0 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -815,11 +815,8 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, slave_sg_todev_fill_desc: desc = dwc_desc_get(dwc); - if (!desc) { - dev_err(chan2dev(chan), - "not enough descriptors available\n"); + if (!desc) goto err_desc_get; - } desc->lli.sar = mem; desc->lli.dar = reg; @@ -875,11 +872,8 @@ slave_sg_todev_fill_desc: slave_sg_fromdev_fill_desc: desc = dwc_desc_get(dwc); - if (!desc) { - dev_err(chan2dev(chan), - "not enough descriptors available\n"); + if (!desc) goto err_desc_get; - } desc->lli.sar = reg; desc->lli.dar = mem; @@ -923,6 +917,8 @@ slave_sg_fromdev_fill_desc: return &first->txd; err_desc_get: + dev_err(chan2dev(chan), + "not enough descriptors available. Direction %d\n", direction); dwc_desc_put(dwc, first); return NULL; }