From patchwork Sat Apr 1 01:00:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9657417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F02C602BD for ; Sat, 1 Apr 2017 01:00:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D9E728616 for ; Sat, 1 Apr 2017 01:00:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41F17286AE; Sat, 1 Apr 2017 01:00:40 +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=-1.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 825F028616 for ; Sat, 1 Apr 2017 01:00:39 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6F26E26735C; Sat, 1 Apr 2017 03:00:38 +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 0F23626735F; Sat, 1 Apr 2017 03:00:37 +0200 (CEST) Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) by alsa0.perex.cz (Postfix) with ESMTP id 49329267361 for ; Sat, 1 Apr 2017 03:00:27 +0200 (CEST) Received: by mail-pg0-f51.google.com with SMTP id g2so84129991pge.3 for ; Fri, 31 Mar 2017 18:00:27 -0700 (PDT) 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; bh=pmdJRfNgG8zVgAatFU6AsA/kw4OKy66qkUwqZk/93ZA=; b=cNFOt1/T3BkI80WPqzJvVLpmdXQQzLQXFELtK0u6/8P9fE1T2OeSzwrFYGbwWFSzTc GqOorMVHeFH3wvKyZnItVQ7/CdkpmtglkMhbjHUZ92h5piL0o6PK5WBQif0sDZaDteff qBl+JQlGoh4FyeXcgFcCSEPk2y4TMD6daXH9jSFGdRTIod+YJYXi321EQCU3cONtTY8t bpYcZlsK2E2wGgq41JmHKH0xcuskvt0o9kV6Hamr9gQHBPrSm/DnIgPE/k0f+pQLZLtt EOQluUXL+lP+12usV5F1YebACBTP6kPGVsvDhc8m0P0nZvtMuOhw6ricl3xXwvILGkpF +STg== X-Gm-Message-State: AFeK/H0Q5l0T8WgAGtXENkHowoTeDSksLjeC6SjRXWa+rER1ys/CFL9E6NQr/QheMf/qN5Lw X-Received: by 10.98.149.147 with SMTP id c19mr5114551pfk.36.1491008426502; Fri, 31 Mar 2017 18:00:26 -0700 (PDT) Received: from mka.mtv.corp.google.com ([172.22.64.162]) by smtp.gmail.com with ESMTPSA id x65sm12566880pfb.111.2017.03.31.18.00.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 Mar 2017 18:00:25 -0700 (PDT) From: Matthias Kaehlcke To: Jaroslav Kysela , Takashi Iwai , Sven Hahne , Julia Lawall Date: Fri, 31 Mar 2017 18:00:04 -0700 Message-Id: <20170401010005.90685-1-mka@chromium.org> X-Mailer: git-send-email 2.12.2.564.g063fe858b8-goog Cc: alsa-devel@alsa-project.org, Grant Grundler , linux-kernel@vger.kernel.org, Greg Hackmann , Michael Davidson , Matthias Kaehlcke Subject: [alsa-devel] [PATCH v2] ALSA: hda/ca0132: Limit values for chip addresses to 32-bit 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 With the previous unsigned long value clang generates warnings like this: sound/pci/hda/patch_ca0132.c:860:37: error: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 18446744073709551615 to 4294967295 [-Werror,-Wconstant-conversion] spec->curr_chip_addx = (res < 0) ? ~0UL : chip_addx; ~ ^~~~ Signed-off-by: Matthias Kaehlcke --- Changes in v2: - Remove unnecessary cast to u32 sound/pci/hda/patch_ca0132.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 07a9deb17477..2023fe472be1 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -857,7 +857,7 @@ static int chipio_write_address(struct hda_codec *codec, chip_addx >> 16); } - spec->curr_chip_addx = (res < 0) ? ~0UL : chip_addx; + spec->curr_chip_addx = (res < 0) ? ~0U : chip_addx; return res; } @@ -882,7 +882,7 @@ static int chipio_write_data(struct hda_codec *codec, unsigned int data) /*If no error encountered, automatically increment the address as per chip behaviour*/ spec->curr_chip_addx = (res != -EIO) ? - (spec->curr_chip_addx + 4) : ~0UL; + (spec->curr_chip_addx + 4) : ~0U; return res; } @@ -933,7 +933,7 @@ static int chipio_read_data(struct hda_codec *codec, unsigned int *data) /*If no error encountered, automatically increment the address as per chip behaviour*/ spec->curr_chip_addx = (res != -EIO) ? - (spec->curr_chip_addx + 4) : ~0UL; + (spec->curr_chip_addx + 4) : ~0U; return res; }