From patchwork Thu Jun 6 05:12:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10978637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7120B14E5 for ; Thu, 6 Jun 2019 06:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6226D287C9 for ; Thu, 6 Jun 2019 06:13:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5630B28784; Thu, 6 Jun 2019 06:13:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4CB15209CE for ; Thu, 6 Jun 2019 06:13:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 68DA517D7; Thu, 6 Jun 2019 07:46:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 68DA517D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1559800068; bh=mL5Ppg0OPbBPpqpDLBLqOs9ZGLsJM2S4mWhwEnWusuc=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=OhhrNQ/DzMwcUe90xau4L4SKew+1cch+0oSU+dC8OwBv3Pb8XgiPuNHwqZFDMdYRf ixmhqHJpl2Q6xwGVaIx2KRSSfQytfQ4rMufdBVe7pY5lLj4NnZdNvlJH2g5fFauwBp 9kdmlflQbHoa6KPdj10GTFDFG0Po8UbUtTbgQu2Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E6132F80768; Thu, 6 Jun 2019 07:13:18 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7944AF896F8; Thu, 6 Jun 2019 07:13:17 +0200 (CEST) Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 01B83F80768 for ; Thu, 6 Jun 2019 07:13:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 01B83F80768 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MjFf2ldx" Received: by mail-ed1-x544.google.com with SMTP id w13so1429276eds.4 for ; Wed, 05 Jun 2019 22:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TB8sS/vN2hoBvG32s7LAFoRj2modDqZ8Vw8VYR421Os=; b=MjFf2ldxuuMeQK2ueNysoMCjQ5uKFh8bYW8bd5QRJmBjp0XW72ybPDZ50jMKO/LiSV wgh4Z7KeeN2RzBRojIpnBqr/dnP8CiGrpyuCbbQjDXDTnExaiokJE/zfXJ0IDTqCaz9D FJMVk+QLuSm/PqCjPGqONXD6twdngAgROD4C5SxKe2qF/9kxBec3iI3PtqPrUyzIEwbC 900yi3vGFTHpBMUa/30nkasZZ/WPO0YYlmp66kgZbudm+p5n4VwfBWMsOvmDCNIAOZeJ n8oajfRGrZciYch4GbP81eTkeDknI7VQ2TdstrYft6tCJb55UaVFmgIEFiL1iLZ9Doi9 +QOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TB8sS/vN2hoBvG32s7LAFoRj2modDqZ8Vw8VYR421Os=; b=agcV4i2ibpnhfwPK07PH4iFH6NFVb4xA9N/lQHXu2Gn+/sQ0lYLZU92woRMAvwjk66 ae0AVbch9igwDr/ixL0f5zlzJ/mNk4p0jCafsKAr4CA5gwabaMvA6Ma5izkdiA657fUh B7AdygWI14KxCpjZ7mCLQ/qqysGncR6bpB118IzaRNW5X9N4GJdF/5Jx/xbUhwFtaeKU RUR6/LSBIN87eKOSl7vrcNMxyLZ7AbXfyMVE9wR6SfPFQ9szaOKuURiHMlvYG5xnM0oq SQYIcC2ffnZHotQKzZxxdZLAqzRsRLuooGlKYNrpTIXtfq6OuWa0cwW7FumBsz+/JGDk fCqA== X-Gm-Message-State: APjAAAU4n/avR5mw56yTq0/PEtYhPZdaaivnzlPkdpXcq4c4NPMiyejU WheErqxPJN6R/TR9J5NO/d8= X-Google-Smtp-Source: APXvYqyUItVGIKxTOm7o1yTUkO+9+3tvHBVATXfJBTetD2HC4spaXlxx/ZTWFbNQ68lfH2yFzqCfwA== X-Received: by 2002:a17:906:6a97:: with SMTP id p23mr39152490ejr.203.1559797993974; Wed, 05 Jun 2019 22:13:13 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f9:2b:2b15::2]) by smtp.gmail.com with ESMTPSA id f3sm141499ejc.15.2019.06.05.22.13.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 05 Jun 2019 22:13:13 -0700 (PDT) From: Nathan Chancellor To: Shuming Fan , Mark Brown Date: Wed, 5 Jun 2019 22:12:27 -0700 Message-Id: <20190606051227.90944-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.22.0.rc3 MIME-Version: 1.0 X-Patchwork-Bot: notify Cc: Oder Chiou , alsa-devel@alsa-project.org, Nick Desaulniers , Liam Girdwood , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Bard Liao , Nathan Chancellor Subject: [alsa-devel] [PATCH] ASoC: rt1011: Mark format integer literals as unsigned X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang warns: sound/soc/codecs/rt1011.c:1291:12: warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C89; this literal will have type 'long long' in C99 onwards [-Wc99-compat] format = 2147483648; /* 2^24 * 128 */ ^ sound/soc/codecs/rt1011.c:2123:13: warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C89; this literal will have type 'long long' in C99 onwards [-Wc99-compat] format = 2147483648; /* 2^24 * 128 */ ^ 2 warnings generated. Mark the integer literals as unsigned explicitly so that if the kernel does ever bump the C standard it uses, the behavior is consitent. Fixes: d6e65bb7ff0d ("ASoC: rt1011: Add RT1011 amplifier driver") Link: https://github.com/ClangBuiltLinux/linux/issues/506 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers --- sound/soc/codecs/rt1011.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt1011.c b/sound/soc/codecs/rt1011.c index 349d6db7ecd4..3a0ae80c5ee0 100644 --- a/sound/soc/codecs/rt1011.c +++ b/sound/soc/codecs/rt1011.c @@ -1288,7 +1288,7 @@ static int rt1011_r0_load_mode_put(struct snd_kcontrol *kcontrol, if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { rt1011->r0_reg = ucontrol->value.integer.value[0]; - format = 2147483648; /* 2^24 * 128 */ + format = 2147483648U; /* 2^24 * 128 */ r0_integer = format / rt1011->r0_reg / 128; r0_factor = ((format / rt1011->r0_reg * 100) / 128) - (r0_integer * 100); @@ -2120,7 +2120,7 @@ static int rt1011_calibrate(struct rt1011_priv *rt1011, unsigned char cali_flag) dev_err(dev, "Calibrate R0 Failure\n"); ret = -EAGAIN; } else { - format = 2147483648; /* 2^24 * 128 */ + format = 2147483648U; /* 2^24 * 128 */ r0_integer = format / r0[0] / 128; r0_factor = ((format / r0[0] * 100) / 128) - (r0_integer * 100);