From patchwork Thu Sep 17 10:13:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 7205561 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 25DAE9F336 for ; Thu, 17 Sep 2015 10:14:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63D882081A for ; Thu, 17 Sep 2015 10:14:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F777207C3 for ; Thu, 17 Sep 2015 10:14:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753294AbbIQKOM (ORCPT ); Thu, 17 Sep 2015 06:14:12 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:43997 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbbIQKNu (ORCPT ); Thu, 17 Sep 2015 06:13:50 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8HADf1h019869; Thu, 17 Sep 2015 05:13:41 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HADfE9007732; Thu, 17 Sep 2015 05:13:41 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 17 Sep 2015 05:13:41 -0500 Received: from imryr.emea.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HADdLh014610; Thu, 17 Sep 2015 05:13:40 -0500 From: Jyri Sarha To: , CC: , , , Jyri Sarha Subject: [PATCH v3] ASoC: soc-core: Fix sparse warning in be32_to_cpup() call Date: Thu, 17 Sep 2015 13:13:38 +0300 Message-ID: <1442484818-30983-1-git-send-email-jsarha@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 Store return value of of_get_property() to a pointer of __be32 type as device tree has big endian type. This fixes a sparse warning couple of lines later when be32_to_cpup() is used to convert from big endian to cpu endian. The whole conversion is not really necessary, as we are only checking if the value is zero or not, but I wanted to add it to remind in the future that the data has to be converted before use. Compiler should optimize the unnecessary operations away. Signed-off-by: Jyri Sarha --- Damn, I wrote description ready but forgot to produce the patch again. So here is a v3 of the same one liner patch. sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1929f0e..af4999c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3294,7 +3294,7 @@ static int snd_soc_of_get_slot_mask(struct device_node *np, unsigned int *mask) { u32 val; - const u32 *of_slot_mask = of_get_property(np, prop_name, &val); + const __be32 *of_slot_mask = of_get_property(np, prop_name, &val); int i; if (!of_slot_mask)