From patchwork Tue Dec 11 15:05:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 13481 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id F17DE23FE1 for ; Tue, 11 Dec 2012 17:13:55 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by fiordland.canonical.com (Postfix) with ESMTP id 549A9A1858F for ; Tue, 11 Dec 2012 17:13:55 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id k10so13076096iea.15 for ; Tue, 11 Dec 2012 09:13:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-virus-scanned:dkim-signature:dkim-signature:from:to:date :message-id:x-mailer:x-mailman-approved-at:cc:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=mbXL2KoW/PfHLsn5lw6ttxXrxVw+4EsBItnUMYhWDGw=; b=Z6jJC1F3v70RMEkkfkJgNQcdZLbxOC+v3TluHpvOSgOL/46jCtqBueTX9iF8JvRLf2 BXlRdMTU9hlFenKwgIYPeXv5eCS+om8C2bGOahzR3RePiSUV8xa3g3bpPQxLo0EnyvRE FMro0Vu3SV9/pp1KUHtp0uIqQw5twpBBkpOJVpJ1GXU0bwjQBwWO6BGm/DKzNGTP31vQ f/jRRs4wMAQYfU+0CeZY4f7dpPqXQM1z4LHx3uiuBN3Km+xtvCX81jXDUebrSV3XVLPW NlBYDxDLs/9awDZPL8ucuIMt7MH0FpApPLPR1igLVjUtzJ8vdXzBSdFb6fDImIKYNXvi jVlQ== Received: by 10.50.42.168 with SMTP id p8mr10512218igl.57.1355246034677; Tue, 11 Dec 2012 09:13:54 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp145803igt; Tue, 11 Dec 2012 09:13:53 -0800 (PST) Received: by 10.204.5.133 with SMTP id 5mr6571402bkv.68.1355246032674; Tue, 11 Dec 2012 09:13:52 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id hi14si31755466bkc.148.2012.12.11.09.13.46; Tue, 11 Dec 2012 09:13:52 -0800 (PST) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TiTOp-0003Bk-SG; Tue, 11 Dec 2012 17:13:43 +0000 Received: from mail.skyhub.de ([78.46.96.112]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TiRON-0005b8-Uk for linaro-mm-sig@lists.linaro.org; Tue, 11 Dec 2012 15:05:08 +0000 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1355238307; bh=feBPHkvqtRd4k6W9WulR9nZpz3Dk13DKVEsSXXSFxkU=; h=From:To:Cc:Subject:Date:Message-Id; b=JvlTRdE55g7cgG00wwgWhjNF+fo 7U2qT9EEqUCCGcpBWm0eMt4ksTO9EyFgUgwxcRn3fpu/LFZ8DRl9v5v2J39nHUsHmR4 XPoGGCE9aR7oC19FZ4chuCAy9gCSy3sAEJAx430PaqftTLcV8mv878R52KC1k9/oZIW UV6Bq389Vg= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qellHd6Z8guC; Tue, 11 Dec 2012 16:05:07 +0100 (CET) Received: from x1.localdomain (p54B7F024.dip.t-dialin.net [84.183.240.36]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 378031D9C1C; Tue, 11 Dec 2012 16:05:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1355238307; bh=feBPHkvqtRd4k6W9WulR9nZpz3Dk13DKVEsSXXSFxkU=; h=From:To:Cc:Subject:Date:Message-Id; b=JvlTRdE55g7cgG00wwgWhjNF+fo 7U2qT9EEqUCCGcpBWm0eMt4ksTO9EyFgUgwxcRn3fpu/LFZ8DRl9v5v2J39nHUsHmR4 XPoGGCE9aR7oC19FZ4chuCAy9gCSy3sAEJAx430PaqftTLcV8mv878R52KC1k9/oZIW UV6Bq389Vg= Received: from x1.bbf.wlan (localhost [127.0.0.1]) by x1.localdomain (Postfix) with ESMTP id 1DF7BE0EC; Tue, 11 Dec 2012 16:05:30 +0100 (CET) From: Borislav Petkov To: Sumit Semwal Date: Tue, 11 Dec 2012 16:05:26 +0100 Message-Id: <1355238326-9482-1-git-send-email-bp@alien8.de> X-Mailer: git-send-email 1.8.0 X-Mailman-Approved-At: Tue, 11 Dec 2012 17:13:43 +0000 Cc: linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman , Borislav Petkov , LKML Subject: [Linaro-mm-sig] [PATCH] dma_buf: Cleanup dma_buf_fd X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQkkJeBjtEldh1AjuQoVOWgobHaIkZL+ZROGIwMb7fbN9iXiK3aQETHPJ7dLai++EHHVyQUC Remove redundant 'error' variable. Signed-off-by: Borislav Petkov --- drivers/base/dma-buf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c index 460e22dee36d..a384b63be757 100644 --- a/drivers/base/dma-buf.c +++ b/drivers/base/dma-buf.c @@ -134,15 +134,14 @@ EXPORT_SYMBOL_GPL(dma_buf_export); */ int dma_buf_fd(struct dma_buf *dmabuf, int flags) { - int error, fd; + int fd; if (!dmabuf || !dmabuf->file) return -EINVAL; - error = get_unused_fd_flags(flags); - if (error < 0) - return error; - fd = error; + fd = get_unused_fd_flags(flags); + if (fd < 0) + return fd; fd_install(fd, dmabuf->file);