Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3366935pxf; Mon, 22 Mar 2021 04:57:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFnyt0gjLXztdzcIXZUc7uarnctAIjxm+ksdQLPJCpAK2bR0khb3Kfq2ST3CDaOkPRHtXn X-Received: by 2002:a17:906:2818:: with SMTP id r24mr18966722ejc.502.1616414273028; Mon, 22 Mar 2021 04:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616414273; cv=none; d=google.com; s=arc-20160816; b=pMs+tdK/1Eq4VPHe13oknIGw4ZuMEtkY69bwxKEU4vPCKIaftH047NXWQFqKPTLT+K l1i0ovpXaLetkWqj/m9a27wmyGv0La30AVRbqtW8PfHuspmsE7eQDKzh6KyrPeJMSwpG qaIkgFD0nGBP2LMy//BekK8JpHb+vSFY8V7kNsTEzDllQCeKxxga4Y/5YbtNQXvCYg3Y Pm8/whEjC4zSFYgCNockPtvBIMzTL4TEm20W5K2tJlcxqzoiIQkFVe3uwGr+/2CR58J7 E2XYqQ+aM2XBeRqkgSI2H6DqfhwP7dsX+PZR7B9GbI7d9jUUXRpq1N1jckSIUT52N5Qn f5TA== 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=QwLCVXBEzBLAxYbiViTBKzfYDmQ3nnX7veqFFad06X0=; b=w0T8tBLtF9pejBlPriluLTG19QEMagjMRVipjoDkvNEeeJNs66DxtxeE8zymUjao9v LDtcpqoAI9L1HuOM1MSB88xEIIhJaih54r5tPfGEW3zCPWsNV1OxeMMx8pQOvpWbr6sE SD3kixOzEJTFNlg9NLz/r3gecf3MSAedMwR9ypt5hDbTvr+qNSn9EDPJhWueIWWhWM0U fEKUVvBjFLrPHYSRvOmeaO6magij/tw/l7kL1XdXl1w1mAhmaSdSKpmDdUE6zvyisnA6 QXeSW8WJTSH+CmtqJV4LIQiqPYMkJYkTjtzdQ8hZrMHQyOXXvWJ6vOKVt+WRux2aLkaD xn5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HhEl8R7w; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si10939623edw.62.2021.03.22.04.57.31; Mon, 22 Mar 2021 04:57:53 -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=@kernel.org header.s=k20201202 header.b=HhEl8R7w; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbhCVL43 (ORCPT + 99 others); Mon, 22 Mar 2021 07:56:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbhCVL4H (ORCPT ); Mon, 22 Mar 2021 07:56:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5740D61993; Mon, 22 Mar 2021 11:56:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616414166; bh=v02+Q4Y/k5N5zyuH15US/OzUofNlFXTHJrTv94Wy354=; h=From:To:Cc:Subject:Date:From; b=HhEl8R7wxUe6N6+JjBywxIcTizWiUXEt1SOxVHC7RILixuJUgrUWRN3OS9QOhtXP+ BLNmFhlvHGPRlqU0k3AqRRg/1Zu8AffkAp+cQ9PCpvJzlOr2W6xbVUChwACDnk9/5W 8i0kkZZ5zSj4MCtxokKGXJVYQ7EaFMzwuJb9TDPCD1peJHsxwKhkQg5mEEil73yhfP hwnJ4i3TMEv7oo5Mh4k0jfVMAs5bDN1yxe33n4jACq2hCQ6yEwdx8TVjYXRKwyKUjn sbA2WUThcixS0dGT2U2hKNY1QJmVg7eJ3ohTLSzvHGqbXYVU8UQBhu/xdvFSU4mrc5 K1ppWa6mTt7Eg== From: Arnd Bergmann To: Benson Leung , Enric Balletbo i Serra , Nathan Chancellor , Nick Desaulniers , Prashant Malani , Heikki Krogerus Cc: Arnd Bergmann , Guenter Roeck , Greg Kroah-Hartman , Azhar Shaikh , Utkarsh Patel , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] platform/chrome: cros_ec_typec: fix clang -Wformat warning Date: Mon, 22 Mar 2021 12:55:55 +0100 Message-Id: <20210322115602.4003221-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Clang warns about using the %h format modifier to truncate an integer: drivers/platform/chrome/cros_ec_typec.c:1031:3: error: format specifies type 'unsigned char' but the argument has type 'unsigned int' [-Werror,-Wformat] typec->pd_ctrl_ver); ^~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:131:47: note: expanded from macro 'dev_dbg' dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ Use an explicit bit mask to limit the number to its lower eight bits instead. Fixes: ad7c0510c99e ("platform/chrome: cros_ec_typec: Update port info from EC") Signed-off-by: Arnd Bergmann --- drivers/platform/chrome/cros_ec_typec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 0811562deecc..f07b7e946560 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -1027,8 +1027,8 @@ static int cros_typec_get_cmd_version(struct cros_typec_data *typec) else typec->pd_ctrl_ver = 0; - dev_dbg(typec->dev, "PD Control has version mask 0x%hhx\n", - typec->pd_ctrl_ver); + dev_dbg(typec->dev, "PD Control has version mask 0x%02x\n", + typec->pd_ctrl_ver & 0xff); return 0; } -- 2.29.2