From patchwork Thu Jun 5 12:12:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 4304671 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0DB68BEEA7 for ; Thu, 5 Jun 2014 12:13:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 432DA20306 for ; Thu, 5 Jun 2014 12:13:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C46AF20251 for ; Thu, 5 Jun 2014 12:13:40 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A95162656A8; Thu, 5 Jun 2014 14:13:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 96B59265648; Thu, 5 Jun 2014 14:13:00 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 71619265659; Thu, 5 Jun 2014 14:12:58 +0200 (CEST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by alsa0.perex.cz (Postfix) with ESMTP id 937D126565F for ; Thu, 5 Jun 2014 14:12:35 +0200 (CEST) Received: by mail-wi0-f174.google.com with SMTP id r20so10382874wiv.1 for ; Thu, 05 Jun 2014 05:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DGdvrAnZvhhmMawi5AC3msI9kzv2mH3sM1JRObirsyY=; b=h06NcuG2hO2oe3WLwF3St/KVg8ucSYkivKqp7vChzdnuQjYIYDMQXZ68W8kcU4ZC8S c2E13AzhD8jhk2vswhew/FVxfn9vf7MelCUtivcjbd1HkQCNHI1QPTdoHoePB6JDznjZ +mg3kJPNEt1pj2k4mEC37PAXSASUPBaWUU1XGlYI5ME67CmwzIDsHPdwOOe++QE7lF6/ 7pBAH5s0i66HTClDdB27/0YQr3/YzZQzuvauDEq1ZybQSBzbWdJbBqAzxU4/3H2zw3cO AjidqMb82bKWPje3qRNLWpVvEiQvrfWgbQyfo4hIFtg/u/i4P4nqFW0CShnPQimPaX6i 5NLA== X-Received: by 10.180.78.71 with SMTP id z7mr15557414wiw.14.1401970354650; Thu, 05 Jun 2014 05:12:34 -0700 (PDT) Received: from tamtam.fritz.box ([2001:4dd0:ff00:9394:224:d7ff:fec6:a0ec]) by mx.google.com with ESMTPSA id lq14sm53873627wic.7.2014.06.05.05.12.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jun 2014 05:12:34 -0700 (PDT) From: Daniel Mack To: tiwai@suse.de Date: Thu, 5 Jun 2014 14:12:26 +0200 Message-Id: <1401970346-9043-2-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1401970346-9043-1-git-send-email-zonque@gmail.com> References: <1401970346-9043-1-git-send-email-zonque@gmail.com> Cc: alsa-devel@alsa-project.org, Daniel Mack Subject: [alsa-devel] [PATCH 2/2] ALSA: sound_firmware: fix style issues X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Fix some style issues in sound/sound_firmware.c. No functional change. Signed-off-by: Daniel Mack --- sound/sound_firmware.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sound/sound_firmware.c b/sound/sound_firmware.c index b155137..247858d 100644 --- a/sound/sound_firmware.c +++ b/sound/sound_firmware.c @@ -4,46 +4,47 @@ #include #include #include -#include +#include #include "oss/sound_firmware.h" static int do_mod_firmware_load(const char *fn, char **fp) { - struct file* filp; + struct file *filp; long l; char *dp; loff_t pos; filp = filp_open(fn, 0, 0); - if (IS_ERR(filp)) - { + if (IS_ERR(filp)) { printk(KERN_INFO "Unable to load '%s'.\n", fn); return 0; } + l = i_size_read(file_inode(filp)); - if (l <= 0 || l > 131072) - { + if (l <= 0 || l > 131072) { printk(KERN_INFO "Invalid firmware '%s'\n", fn); fput(filp); return 0; } + dp = vmalloc(l); - if (dp == NULL) - { + if (dp == NULL) { printk(KERN_INFO "Out of memory loading '%s'.\n", fn); fput(filp); return 0; } + pos = 0; - if (vfs_read(filp, dp, l, &pos) != l) - { + if (vfs_read(filp, dp, l, &pos) != l) { printk(KERN_INFO "Failed to read '%s'.\n", fn); vfree(dp); fput(filp); return 0; } + fput(filp); *fp = dp; + return (int) l; } @@ -63,7 +64,7 @@ static int do_mod_firmware_load(const char *fn, char **fp) * Caution: This API is not recommended. Firmware should be loaded via * request_firmware. */ - + int mod_firmware_load(const char *fn, char **fp) { int r;