Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4819261pxj; Wed, 9 Jun 2021 02:37:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6iu+6QY70X9XV+DAQOgGEMZkrBkdxwXzrJwNTeowod4fT3ANlie40BnkVV+6pbX1E+q5C X-Received: by 2002:a92:7c02:: with SMTP id x2mr23444982ilc.8.1623231442774; Wed, 09 Jun 2021 02:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623231442; cv=none; d=google.com; s=arc-20160816; b=CU8tRlEC/VwI+h7EZMTEYf+tKRogkYlxapS534Ns5JXOVEPNH8h2wzZsJ4p35n2jzJ 5WfFDfK+qdYq2X5A9c2MudHshTRp1UUso22969xTDuGJiwd//WZTffa7Ew1bOofCDDNx vT1F9kipPJ2Rj2+aDp0cobuRrq74Sx+8LaGxYo85ShGsOcN3EkTxot0vXJe2xqjHHLkJ XgP1VD80pcQvMNQgnkTRnOW+ASnX9is3D9PLjus2yPcfOY/yWA1Gz5leeEir9k5JxUmR IY/7b3Kqg7/UR5eKnDHN6DECZ2Wx9nTj9U4R50JPtOE4CYMYooxyhxmLAB8qWWEW9DKd lGTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=k/EJzQ4kkNzGI6vtabjtkoImwTOCjlnR1d/wAmwO3OU=; b=Y4V3ic3b0wufkyarEG+mvKWi5FFRoAu5e+DgJQ/YeXDkrUto3k0iexPCzwkkUhgJ+m i6QhwuHmVSkpYYx2Emx14v7QXqBH8wTVytz1lEnj92lOZ9II+qHkgPjX4c0+E7MjK0sI G9cfE3nP14iq36g3oFtlMVVIpXo5Wo3tG2QWqrneJsFoFKEUZbQRu2WR7b+6CGuNf59n FjMP/vja7gHVMfCceojJHYY3Ujdg/CSTz2OjpoQ7boMSLOjff4JtDqWHXQgUbnpvZsL5 RbfR+tHMiWl+caTtjXVAykhS4MvUP8m68UGIKYNJg7PzqkgMb41nyA6DXD6XlGVTHo18 ReHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rpo2Qo10; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si2747814ilo.64.2021.06.09.02.37.07; Wed, 09 Jun 2021 02:37:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rpo2Qo10; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234563AbhFHSer (ORCPT + 99 others); Tue, 8 Jun 2021 14:34:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:57310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234587AbhFHSdS (ORCPT ); Tue, 8 Jun 2021 14:33:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BC9A613AC; Tue, 8 Jun 2021 18:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177063; bh=YxdeiHOy2hyiCULXUy9RIlLXnXSrI3pEcvAernlVT6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rpo2Qo10xolQDunrtR1kwzlRYRFPoVrc/Q1HnK8d7ahMGtdMSBH+vyAvBJB73Hhaw 7ALOe/Cbyu4KXkJ0oLuK5tzHMeg8tFzFloHZAApZ49PqNII+0H4YMIkp/Ktp7ORB13 IOunS4Erfv440pQMRENHncv8ECzBFrNPJHlXoRc8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nathan Chancellor , Jiri Kosina , Sasha Levin Subject: [PATCH 4.14 09/47] HID: i2c-hid: fix format string mismatch Date: Tue, 8 Jun 2021 20:26:52 +0200 Message-Id: <20210608175930.786097798@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175930.477274100@linuxfoundation.org> References: <20210608175930.477274100@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit dc5f9f55502e13ba05731d5046a14620aa2ff456 ] clang doesn't like printing a 32-bit integer using %hX format string: drivers/hid/i2c-hid/i2c-hid-core.c:994:18: error: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Werror,-Wformat] client->name, hid->vendor, hid->product); ^~~~~~~~~~~ drivers/hid/i2c-hid/i2c-hid-core.c:994:31: error: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Werror,-Wformat] client->name, hid->vendor, hid->product); ^~~~~~~~~~~~ Use an explicit cast to truncate it to the low 16 bits instead. Fixes: 9ee3e06610fd ("HID: i2c-hid: override HID descriptors for certain devices") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/i2c-hid/i2c-hid-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 0294cac4c856..b16bf4358485 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -1092,8 +1092,8 @@ static int i2c_hid_probe(struct i2c_client *client, hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID); hid->product = le16_to_cpu(ihid->hdesc.wProductID); - snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX", - client->name, hid->vendor, hid->product); + snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", + client->name, (u16)hid->vendor, (u16)hid->product); strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys)); ihid->quirks = i2c_hid_lookup_quirk(hid->vendor, hid->product); -- 2.30.2