From patchwork Wed Jul 25 16:40:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 142878 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1029486ljj; Wed, 25 Jul 2018 09:40:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcDMmNLoX1h+6TbZ0oMvbYDYKJ0Bx59ROr/1T25K1kwiNxkrg0BMEsC9aAwYopJK/cwyVA/ X-Received: by 2002:adf:e3c5:: with SMTP id k5-v6mr15591163wrm.94.1532536823848; Wed, 25 Jul 2018 09:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532536823; cv=none; d=google.com; s=arc-20160816; b=ccjNGR5BKFocIsD/8NW5V3VdJITyX7XZ+pwB5tYi0DOWmk8v3lYT9cITWrlUTkNYq2 8BJjmj5fQRbN3ID97wyUAmhKYWdgC8Adb3IB3PoQrHKf4JbNs5siqNIfg7YpWfCZ6CZT vWkc/IVMdtOc+/2uLUMOsBRciRjaGpEeChb7Zxn4qkGl93M7T7itfUwBIACml7YyqWJo Qcf0MpNz2blXjHsRTxFSiqersNn0tgrlsBwRMrlNKuHg/tACRcclCbZ6tsgqsxe4iipM /on14ejx7QfBcxcLQk5DxF4+CNRPexLHb7tAplevq+0gGCZb80W4U7m/qMDsfrdwZEbG +zpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=8B4krRNPyyi420ef6KUxgyVJT+aUwZKkvIfAliWPyxY=; b=z3bvAQ2nM8kf4sjtZlhFy5fQJqFZccs7qzjwVxl6EsFlQwLrG2b2sAktTd0/+UXUlk Gs6Y2YtT1OjmyjjUmhPb1nldKenjieAFMRP99SVWcM6Hzen4yuLXRez6r8bL2Qq1yxWk /0KttNnICoCsRpbdXF1kVqYKLaMl8vLjmv5b82foP5fL7gsqxU9hhDUH9R99FySCedEI xzfP1arXeXwoNYfQLs4xgAUyy+qduc7XD+jKMnQofG7bAs6ey68DmR1gh1fiJaSsuWVH 6+io0kOe4m0wDTjAI2LKS7XzCODaLqtHzB3zX0mWcOfYObkUCz2ZK2b+jvsyNKILkweE nywA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="L/RV7393"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id n13-v6si11477714wrt.154.2018.07.25.09.40.23; Wed, 25 Jul 2018 09:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="L/RV7393"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CC61E26778C; Wed, 25 Jul 2018 18:40:20 +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 1000F26778D; Wed, 25 Jul 2018 18:40:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 45B0F267796 for ; Wed, 25 Jul 2018 18:40:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=B2EzH1L9T8MsQHE4oRDwLHVY+SWygtvT9yO3Tj5xCMc=; b=L/RV73937/EL niQE9k1JYdiT9Zn8QMMbfJdFmCZXHgqNZlr7w1MA7Xps7ox8W2hJurbX/UynyNE0DEZSvwGEjogOZ Q0rlP4RCr0jRQeHlydVj2luAYwMY0KG5IATkU5JX3813OTa9VLidByZvxmvYWc1FQy5BlUqOQoTJt EP6To=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fiMph-0006lO-JP; Wed, 25 Jul 2018 16:40:13 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 55AEB1123B08; Wed, 25 Jul 2018 17:40:13 +0100 (BST) From: Mark Brown To: Pierre-Louis Bossart In-Reply-To: <20180724211248.29427-6-pierre-louis.bossart@linux.intel.com> Message-Id: <20180725164013.55AEB1123B08@debutante.sirena.org.uk> Date: Wed, 25 Jul 2018 17:40:13 +0100 (BST) Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com, alsa-devel@alsa-project.org, broonie@kernel.org, vkoul@kernel.org Subject: [alsa-devel] Applied "ASoC: Intel: Atom: simplify iomem address and casts" to the asoc tree 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 The patch ASoC: Intel: Atom: simplify iomem address and casts has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From ce1cfe295abaa7436f9049bcb2562c843089abfc Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 24 Jul 2018 16:12:47 -0500 Subject: [PATCH] ASoC: Intel: Atom: simplify iomem address and casts Simplify code and add relevant casts to make Sparse warnings go away Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- sound/soc/intel/atom/sst/sst_drv_interface.c | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c index 6a8b253c58d2..5455d6e0ab53 100644 --- a/sound/soc/intel/atom/sst/sst_drv_interface.c +++ b/sound/soc/intel/atom/sst/sst_drv_interface.c @@ -266,17 +266,15 @@ static int sst_cdev_ack(struct device *dev, unsigned int str_id, stream->cumm_bytes += bytes; dev_dbg(dev, "bytes copied %d inc by %ld\n", stream->cumm_bytes, bytes); - memcpy_fromio(&fw_tstamp, - ((void *)(ctx->mailbox + ctx->tstamp) - +(str_id * sizeof(fw_tstamp))), - sizeof(fw_tstamp)); + addr = ((void __iomem *)(ctx->mailbox + ctx->tstamp)) + + (str_id * sizeof(fw_tstamp)); + + memcpy_fromio(&fw_tstamp, addr, sizeof(fw_tstamp)); fw_tstamp.bytes_copied = stream->cumm_bytes; dev_dbg(dev, "bytes sent to fw %llu inc by %ld\n", fw_tstamp.bytes_copied, bytes); - addr = ((void *)(ctx->mailbox + ctx->tstamp)) + - (str_id * sizeof(fw_tstamp)); offset = offsetof(struct snd_sst_tstamp, bytes_copied); sst_shim_write(addr, offset, fw_tstamp.bytes_copied); return 0; @@ -360,11 +358,12 @@ static int sst_cdev_tstamp(struct device *dev, unsigned int str_id, struct snd_sst_tstamp fw_tstamp = {0,}; struct stream_info *stream; struct intel_sst_drv *ctx = dev_get_drvdata(dev); + void __iomem *addr; + + addr = (void __iomem *)(ctx->mailbox + ctx->tstamp) + + (str_id * sizeof(fw_tstamp)); - memcpy_fromio(&fw_tstamp, - ((void *)(ctx->mailbox + ctx->tstamp) - +(str_id * sizeof(fw_tstamp))), - sizeof(fw_tstamp)); + memcpy_fromio(&fw_tstamp, addr, sizeof(fw_tstamp)); stream = get_stream_info(ctx, str_id); if (!stream) @@ -530,6 +529,7 @@ static int sst_read_timestamp(struct device *dev, struct pcm_stream_info *info) struct snd_sst_tstamp fw_tstamp; unsigned int str_id; struct intel_sst_drv *ctx = dev_get_drvdata(dev); + void __iomem *addr; str_id = info->str_id; stream = get_stream_info(ctx, str_id); @@ -540,10 +540,11 @@ static int sst_read_timestamp(struct device *dev, struct pcm_stream_info *info) return -EINVAL; substream = stream->pcm_substream; - memcpy_fromio(&fw_tstamp, - ((void *)(ctx->mailbox + ctx->tstamp) - + (str_id * sizeof(fw_tstamp))), - sizeof(fw_tstamp)); + addr = (void __iomem *)(ctx->mailbox + ctx->tstamp) + + (str_id * sizeof(fw_tstamp)); + + memcpy_fromio(&fw_tstamp, addr, sizeof(fw_tstamp)); + return sst_calc_tstamp(ctx, info, substream, &fw_tstamp); }