From patchwork Tue Jun 8 18:26:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 455802 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp4008933jae; Tue, 8 Jun 2021 11:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTdBHojh35FijTdklFTtlcwRgq0PdEm/PiqQVS8RbNZACeSZj4LuNP8OxVNSMc8kHgcMy0 X-Received: by 2002:a17:906:fa93:: with SMTP id lt19mr25622779ejb.54.1623177848671; Tue, 08 Jun 2021 11:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623177848; cv=none; d=google.com; s=arc-20160816; b=vVSYzyiajM0dmvJHMyL8PT6ATMfcAn+izkKcRDNI1j36PkhlClHeE8TfINQyXRvIrJ vK+/Vzs+Jquerhnj3YuDUjJiRtO/bM/aWIUNU9gEAQb8x1ICy713H1CpyAcdBiLuFUTX B74AP+vdZoXHSk5FvLvu1SDMGxuSdQUdUvKbmcspYei0HLeSy15fZ5Ayo3Syg+XW9Kdp 6jfAXNgjDwEVEMpJcJJlC85BPZMZ5bxqXtWI3RCFLrCuQjpXJ36Bbx1rW1G/qkx3FK81 sGfXZcuqRlkn7r3kGrqcmkDdHywjaCqKj93UoceldAY4QRdsd2aZDc4dnzOEO1Bm+Uup 5+6A== 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=U1DKT7VlwbxJNrPJEBaQ+L/1Ebd19bEfrqwybyCorGg=; b=wLoDC8d6Yni1jfxQt17M6bZT7HRb/2YhFY/u2sbSKVhxJdlsusrr3o9M3mMmcgfuHc e2I0O9ZsjUmBCK68omHVZ7DGXLOULla3cjdYhJm8+a8wX8n6DZ92iOuiBoHIvwxKUZTm Q9PzLJTNzTrN7qV3lXpM1M4eCMYU+btooN7o8Z1K9oq+vuTkzVZOjrMS4t/QeJSrjtI4 ZdyEx1d4R+4+HetB73zkYRf0/8WI5QhQqNkBpHNPpSSo0hc1WuHGdfMPWY9VxFcbBNuJ RO5C4UUtLbnkYagHxOUUz+P4BPopyfHxioe9B3Tt57k83q3hkfPnqEq9aLg5h5aI0wTh apHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X56DyvT9; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 i8si367915edr.440.2021.06.08.11.44.08; Tue, 08 Jun 2021 11:44:08 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=X56DyvT9; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S236008AbhFHSps (ORCPT + 12 others); Tue, 8 Jun 2021 14:45:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:37490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234777AbhFHSmM (ORCPT ); Tue, 8 Jun 2021 14:42:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02225613F4; Tue, 8 Jun 2021 18:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177333; bh=mK9oZJ63NEvf2bb3kDoNayCskitowaBCxNQ6yoI0JZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X56DyvT9ZA8piby4HtOpMbUmMp0TxOW53Tw9TRKkahgOvgkVyD0eSHTPuPCfFhyAa mFIN0yjWg8/PVsLlmq8F/JO0t8xVmASndkLcljwBhoAs9PgG5NecjZxfdWu6G+iMTy AIgttKTzih5AfYcZ168QDC574U3kEbNlHICory/M= 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 5.4 15/78] HID: i2c-hid: fix format string mismatch Date: Tue, 8 Jun 2021 20:26:44 +0200 Message-Id: <20210608175935.790810148@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 96898983db99..f67817819f9a 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -1114,8 +1114,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);