Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5991201ybc; Wed, 27 Nov 2019 13:02:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwqjLeut7DmKDZrPIciQOHUrViNUl3HZvgjgwRzAkGRTFzgXhtMkh16xXZsZC/Az5mdJwsE X-Received: by 2002:a50:fc96:: with SMTP id f22mr34593013edq.119.1574888540078; Wed, 27 Nov 2019 13:02:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888540; cv=none; d=google.com; s=arc-20160816; b=nAoBn1/mnEG6k6vebw4nmo1U74AZ6HCFUCNx/7eSt71gY5lMTwSJpmyUuix20INj9K 14mnu1RL4CULeP8d2v+BFGnCprTqGeIDrlX5HTA/Qbvp4riMMbbIOOOvUXQCRDTDniDp NxbdiN1wFBOFcx1DCi6iQkMWHFzsTeArWusJKZ/ZNjjDFcZFVFdm1Dvb+6s3e338rWJE FcHwQlpZa3uwCpc9DRdZnfV9JsEz2aWxCIFlGzmksmLStIAincV4fggQTuEK7FIMGhxA wCLYxKxutjXnyWbjyaVF/ROP1aLBfNV0La+v9tgZBSUSWYh0ZkgSGBuTC0kldlfgXk/h PYHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DLdPAyVkJvlPosUw4/m61DCjEJeQDE349cGbxaQAkKc=; b=MimiEYTidJCY+wCMvhD2sECtCdr5jud/EgPPi3lD9KBOb1Wo/J2MrXM1Rkh+dD8LN3 DlsjlXtaB/FJAH9IlCueeyt+WBDM/dal+xf8kx7pmqB4e4K9gPyWZbXiULPeJYLiu4je Jt9o4qq4/BsCt2yzUTOAOj4dVTvsqunvKdbfI3DO3wuiDj9HUwNXCBQULf+pIc4vhZmh YOsWXNCBh4e9lLxoq+Di8x792GyQjDn9SE6Z5cRVEO//rPk4o7vTh5af8hwgpEVsgQJy 55tSruEDaPMeuzQkxLhzFpXHCRvzCCAQgdMfz6MNtsPBcZ1b5lPWvuCJl20UYqmIpzv3 yAQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XDkRLcI0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15si4191798edy.159.2019.11.27.13.01.56; Wed, 27 Nov 2019 13:02:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XDkRLcI0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731375AbfK0U7D (ORCPT + 99 others); Wed, 27 Nov 2019 15:59:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:50376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731348AbfK0U66 (ORCPT ); Wed, 27 Nov 2019 15:58:58 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C69DC20678; Wed, 27 Nov 2019 20:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888337; bh=ItMXgs/Q9kt+48rsthlnVhaH6dBjICpKcSlbQsKI+IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XDkRLcI0DEgfPG3rkpoEVm4H8DFoVQ0lRrRDb1v6vMrwsTdn4JpEO3+xBA01DuUdc oly70ywgF0iKGIGnMPLzVQNpt0VJsZKodWKB8Fa3xN8pyJlGUasp1cM2TdYAg54Nnm M6+tOjsBhsiQRhuortZCWY3tVauS5fEcuLKCgUX4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Klocke , Takashi Iwai , Sasha Levin Subject: [PATCH 4.19 093/306] ALSA: i2c/cs8427: Fix int to char conversion Date: Wed, 27 Nov 2019 21:29:03 +0100 Message-Id: <20191127203121.701840129@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Philipp Klocke [ Upstream commit eb7ebfa3c1989aa8e59d5e68ab3cddd7df1bfb27 ] Compiling with clang yields the following warning: sound/i2c/cs8427.c:140:31: warning: implicit conversion from 'int' to 'char' changes value from 160 to -96 [-Wconstant-conversion] data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF; ~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ Because CS8427_REG_AUTOINC is defined as 128, it is too big for a char field. So change data from char to unsigned char, that it can hold the value. This patch does not change the generated code. Signed-off-by: Philipp Klocke Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/i2c/cs8427.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c index 2647309bc6757..8afa2f8884660 100644 --- a/sound/i2c/cs8427.c +++ b/sound/i2c/cs8427.c @@ -118,7 +118,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device, struct cs8427 *chip = device->private_data; char *hw_data = udata ? chip->playback.hw_udata : chip->playback.hw_status; - char data[32]; + unsigned char data[32]; int err, idx; if (!memcmp(hw_data, ndata, count)) -- 2.20.1