From patchwork Tue Sep 23 11:00:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 4955521 X-Patchwork-Delegate: tiwai@suse.de 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 4D4AABEEA5 for ; Tue, 23 Sep 2014 11:04:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF5B820131 for ; Tue, 23 Sep 2014 11:04:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 360B9200F3 for ; Tue, 23 Sep 2014 11:04:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3AD792654F6; Tue, 23 Sep 2014 13:04:25 +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, 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 BCA062651A5; Tue, 23 Sep 2014 13:01:28 +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 3EA01265054; Tue, 23 Sep 2014 13:01:26 +0200 (CEST) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by alsa0.perex.cz (Postfix) with ESMTP id 9A883265055 for ; Tue, 23 Sep 2014 13:01:12 +0200 (CEST) Received: by mail-pd0-f171.google.com with SMTP id y13so6300946pdi.2 for ; Tue, 23 Sep 2014 04:01:11 -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=ewq6E9JZ001K9ffqw6wt84enq+S9hrVQqVaOPNkKjC0=; b=FYPmWjbqjsc3mTYbCiNOdulqrAoCAF5qzVf7G8wqLFtouXfm9KtjzDsjeLr/OB535j lIa6NhoFx9Z9saeQeTj7fc/JQgDF2hSKMLHXAxYUaLY3Lzkyk7hyyf0O/TOnmpqZXkvp 8KvbdFM5FLwxYkf46L9PFsgwru0p9tDL2RMZTXD/bRZe/gWk3VTR+s453mDcFs6PTnlD /cd3pG1DfIvRJDAjhU2WZ4X0Kz1l+j+JXtuoFp0qxU3NulVRO/QA41YH3YqTo+rUsr7n MEahyhvkLsleSmWpHAAT4B1qf37fp4UKPQM05aGSOtWAl4etuoBGX/v1sAxBOhgr6Tyx L3Lw== X-Received: by 10.69.17.99 with SMTP id gd3mr12479918pbd.158.1411470071501; Tue, 23 Sep 2014 04:01:11 -0700 (PDT) Received: from localhost.localdomain ([122.169.152.214]) by mx.google.com with ESMTPSA id zn2sm11757781pbb.41.2014.09.23.04.01.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 04:01:11 -0700 (PDT) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Tue, 23 Sep 2014 16:30:24 +0530 Message-Id: <1411470024-25244-5-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1411470024-25244-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1411470024-25244-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: alsa-devel@alsa-project.org, Sudip Mukherjee , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v4 5/5] ALSA: ctxfi: sparse warning 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 fixed sparse warning of incorrect type (different address spaces) in cthw20k1.c and cthw20k2.c which was being actually caused as mem_base was of the type unsigned long. Again as mem_base was previously unsigned long , so it required many typecasts in the code to convert interger to pointer. Now after giving the correct type of mem_base as void __iomem * we can also remove those typecasts maintaining the same functionality and logic of the code. Signed-off-by: Sudip Mukherjee --- sound/pci/ctxfi/cthardware.h | 2 +- sound/pci/ctxfi/cthw20k1.c | 6 +++--- sound/pci/ctxfi/cthw20k2.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/pci/ctxfi/cthardware.h b/sound/pci/ctxfi/cthardware.h index 940bbd0..0be24f7 100644 --- a/sound/pci/ctxfi/cthardware.h +++ b/sound/pci/ctxfi/cthardware.h @@ -188,7 +188,7 @@ struct hw { struct snd_card *card; /* pointer to this card */ int irq; unsigned long io_base; - unsigned long mem_base; + void __iomem *mem_base; enum CHIPTYP chip_type; enum CTCARDS model; diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index b807391..b425aa8 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c @@ -1803,7 +1803,7 @@ static int uaa_to_xfi(struct pci_dev *pci) unsigned int is_uaa; unsigned int data[4] = {0}; unsigned int io_base; - void *mem_base; + void __iomem *mem_base; int i; const u32 CTLX = CTLBITS('C', 'T', 'L', 'X'); const u32 CTL_ = CTLBITS('C', 'T', 'L', '-'); @@ -1987,9 +1987,9 @@ static int hw_card_shutdown(struct hw *hw) hw->irq = -1; if (hw->mem_base) - iounmap((void *)hw->mem_base); + iounmap(hw->mem_base); - hw->mem_base = (unsigned long)NULL; + hw->mem_base = NULL; if (hw->io_base) pci_release_regions(hw->pci); diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index 144fab6..253899d 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -2050,8 +2050,8 @@ static int hw_card_start(struct hw *hw) goto error1; hw->io_base = pci_resource_start(hw->pci, 2); - hw->mem_base = (unsigned long)ioremap(hw->io_base, - pci_resource_len(hw->pci, 2)); + hw->mem_base = ioremap(hw->io_base, + pci_resource_len(hw->pci, 2)); if (!hw->mem_base) { err = -ENOENT; goto error2; @@ -2112,9 +2112,9 @@ static int hw_card_shutdown(struct hw *hw) hw->irq = -1; if (hw->mem_base) - iounmap((void *)hw->mem_base); + iounmap(hw->mem_base); - hw->mem_base = (unsigned long)NULL; + hw->mem_base = NULL; if (hw->io_base) pci_release_regions(hw->pci); @@ -2234,12 +2234,12 @@ static int hw_resume(struct hw *hw, struct card_conf *info) static u32 hw_read_20kx(struct hw *hw, u32 reg) { - return readl((void *)(hw->mem_base + reg)); + return readl(hw->mem_base + reg); } static void hw_write_20kx(struct hw *hw, u32 reg, u32 data) { - writel(data, (void *)(hw->mem_base + reg)); + writel(data, hw->mem_base + reg); } static struct hw ct20k2_preset = {