From patchwork Fri May 14 13:58:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 438907 Delivered-To: patch@linaro.org Received: by 2002:a02:b78d:0:0:0:0:0 with SMTP id f13csp369537jam; Fri, 14 May 2021 06:59:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/N29Eqc6LnijHLkkV16grHa+fvBpwgCOaISgRU8HH4b+F/Io3UDdF9UrTMcPnh7przsUu X-Received: by 2002:a5d:8e03:: with SMTP id e3mr18179861iod.60.1621000795398; Fri, 14 May 2021 06:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621000795; cv=none; d=google.com; s=arc-20160816; b=XaAEHc0wytykFfTi4RORA1ClU1d8MBrCDB1YoHi8z8+XPu6VzlzU2PfQaGjtw/9fx8 4adWqrmQEmbFXl4c7OXZTN6IidyJsqlytQmspdok0WFZ0n/y/HNP5Onago5ArqDDg2oJ 3Yf939D6mqnpOAhg5MHE0gF2gZkPw8ASqzupdUfeZa9bXYsJ+0wD3QxP39D/nnO7q/Fk /VC0BO0VYfpWlKSQjuwygz9SraxeNA+8woyDSdYCjIejQ5fCwm81jiPFJwbNzNYtQ9h2 DvgvXDdXUDZi5SFyR/rJ5GfksdE8owOnf0wm26MHkOJ9PPVNqG2tVmGySZ9cNulF+CkM tq7w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=HSSKbV6oemLrJjJblH7HaVjcC/N3/kulDi59TZXJFY0=; b=whDt/Avf0e1zMyKLu7tdV2+oHdAIGVAHJNQymG09G1BDNgzrmxeDYwuBdczYN1Iuto rx8COYXLQ63jW/eUIrdtxN0kZ7Jjw6ZgemRUE3CYUQa95qeQP4aKoyAJDXOzzwrsoLmt abtGDpaFRlWm9u0NdaFsmUqktacy7phHNyKYfd7iwS6WbjzA1IXcydyMMzYgAbxa6ZDw hv+dkMnNY9X/QH3xF8jIt9xCR6U2Ul71ncZP6eGQgw+Pqma0lmRHDV6YRyvxdmrHgWVH FYJCxMVLi1v3gBHjv/JrB7ZhBUcyColY82Q9LN+uS5EZcRdoB6ocms+6MS0TmyvHc7SN ZcrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uVSWX0Vd; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i21si7935300iov.29.2021.05.14.06.59.55; Fri, 14 May 2021 06:59:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-input-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=@kernel.org header.s=k20201202 header.b=uVSWX0Vd; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbhENOBE (ORCPT + 1 other); Fri, 14 May 2021 10:01:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:59328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbhENOBD (ORCPT ); Fri, 14 May 2021 10:01:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 793C3613E9; Fri, 14 May 2021 13:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621000792; bh=Ow2qpjN+bkVwWRQxi7G/HA/bPZRg73EV0cI+Qppnl1g=; h=From:To:Cc:Subject:Date:From; b=uVSWX0VdAgwE8oNHi7N4hUyTxIxHIEBmiX409MwQtsBRhSynnvCSa7SS9yc663Pin gvRpy2Pl1l9/1FETAhVWQqHuBsn4ksqPz4qAy73tc769g2FOmmSiVgFVRLCsDGImXM xMAvl1qUfYv1TdIzRX5z/+XBvwzUfjDLBeq/g1NbYbpsiO6g26Yo7te61I4O2IuD/n UYvjTaWGm+Empwkz2bGBBQ4twSebbk7ESa+71Ks0CmU60YhcS/PBLPj98m4Ww/BuHt QXNBbRM1GZh9TcFQ9NCanHVp3iJKrl398meP1DkEMJ2V8zh+0CREOGdJ+cnBi9Uq9S QPwP1q3MMxgVQ== From: Arnd Bergmann To: Jiri Kosina , Benjamin Tissoires , Nathan Chancellor , Nick Desaulniers , Julian Sax Cc: Arnd Bergmann , Hans de Goede , Douglas Anderson , Kai-Heng Feng , Xiaofei Tan , Coiby Xu , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] HID: i2c-hid: fix format string mismatch Date: Fri, 14 May 2021 15:58:50 +0200 Message-Id: <20210514135901.2924982-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Arnd Bergmann 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 --- drivers/hid/i2c-hid/i2c-hid-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.29.2 Reviewed-by: Nathan Chancellor diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 9993133989a5..f9d28ad17d9c 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -990,8 +990,8 @@ int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops, 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);