Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3473742pxf; Mon, 22 Mar 2021 07:17:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxySkug8gVZxJgX0BlfNFwTb2eXbqBBbZr/uFn2GwAVx2boqnFiYVbLdEzDzq/qh1EIE++a X-Received: by 2002:a05:6402:2ce:: with SMTP id b14mr25949952edx.13.1616422641690; Mon, 22 Mar 2021 07:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616422641; cv=none; d=google.com; s=arc-20160816; b=Y/hGJHaBOHmTJi4+Zt1b4Gzex/lAvLRcro7iXEsePp4yKKkCv6QGrXaqGuzEH3gWbb mYNNy+Zqtzfe1oQZSFomk7FfSBPG6xXYKJbvkp2TdfP/lkbd6k8oWL2f4Sx1xuKuCaBW 6dYREaw2bAEQXLv8AFP811gB/B7IWE7NoRHVTa2FvN02an63x657xyQXsFwYPsW8imjo uX/VXjxwase3T1EQSvqDIQuiUv4aaHdXQOP/+axTsgJ0aest7NzGI5C9td7pluFTJvhr L96ksyCs4VcO0qj6ffgWkfe2AuIyFYxmTxG+d0LHx/BApylQQtxu3HlV5zc153b8/dH4 XzbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=//tPuGWWU87DrG8mckDF+aLQVmpkf7JGyamDC0ugRSQ=; b=hfxRC56c7lfLSXRhcvUEMsLz7m5WfsoBJ2U5iJYdjpFtYVZ1twjD3rptTc+z2hW5LS FGPqN28KXyguHA2ubso4xzavhCNhQRCXe5v2B+7KsVIJks1PRrrKTNGfe6E7bjmKtcdW RwBQoVyBVVTBoMA0TpnJi3SQM0C46W4NyrnSbJ05JEIGDZNX3GF6Oph6iEFxcwGzNnFk lzVd9EO+8IAC/jTj28zlUf5sInG8vJloNk0/oACluDUGUauy/4Qeq9Pu/bdWFwu6gi55 z59le8V5MjjghhnrUSBV5ydY8JVjRwtUbAbS8+Okvfpsn7qrU9kIrB0P+0BAQFfEwVTM dMsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UwXgYWiz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si10824490eju.427.2021.03.22.07.16.59; Mon, 22 Mar 2021 07:17:21 -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=@google.com header.s=20161025 header.b=UwXgYWiz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbhCVOO7 (ORCPT + 99 others); Mon, 22 Mar 2021 10:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230166AbhCVOOZ (ORCPT ); Mon, 22 Mar 2021 10:14:25 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3635C061574 for ; Mon, 22 Mar 2021 07:14:24 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id r12so21545639ejr.5 for ; Mon, 22 Mar 2021 07:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=//tPuGWWU87DrG8mckDF+aLQVmpkf7JGyamDC0ugRSQ=; b=UwXgYWizC0bDdZzWB229/zIOPwM+lUSe1XMYUEVWrzhX0QXHcWENQBAkOdxC8i9N8V ZJneoaMrZgilbi9+fWxRShRnwLHcN3y59g39XychVt+/od+o8bNtAAQsVREP8NTVYXse fSu/bKtCd/kulgXJiup6CFG0nitpEzz7rlL/V4YvWRQxvrsMNnLHX7Cm6BOOFC9cUJdw rLIXipzNGXZpZtt2UD8oCEV0KYMci//RrgS9GHSAK9kbTgK+0e+3R55BaJlwBcc1wDRV 2tgp+Fq9DIfUpVr9Zm0GZqQ2wA6+FX8IBAPUflfEjHCTh8lYGBVMmtz5C6+bsSJarbP3 CQ+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=//tPuGWWU87DrG8mckDF+aLQVmpkf7JGyamDC0ugRSQ=; b=ozPz4zJ7kkj4/GWEvAkyGtfaL5uJZTkH5oiDlry/hmtnCwOR8m8aea7Aae9zw5cgqn 2c0Kroh027x6B7cqIiNzf59j06bHpvE9S+pPE/ZNqW02wHXHmm9a1s6zsCiPJVrmRgop rshGf1bvN+7sDTQ8P07f4hc2vFNd61sTfPzDgvk8+hhYyIPzBVLyMIYdoKyMqMCIZEcK auyhHgGNNF9bnUeAntUvy4ua4I2aX4eKe6JXJi2VShVRlL2D5sxruxvq2zUxZm83SsJa mpL6UHQQObknnFDrZyDzstt+16+vVCz3/SlItyTIWV3bfGiyF/G4c6mG2zCvqnD1QCDl hDRA== X-Gm-Message-State: AOAM530W8LzLDBBDcrsZYwVfDoDMshPRAiEbCKBMkCd4byx6EsG2HLyg oyo51ReqatuU6kaVwpdQgM6vr7cSbbTBDUHPHYz/CA== X-Received: by 2002:a17:906:90d8:: with SMTP id v24mr19290806ejw.547.1616422463216; Mon, 22 Mar 2021 07:14:23 -0700 (PDT) MIME-Version: 1.0 References: <20210322115602.4003221-1-arnd@kernel.org> In-Reply-To: <20210322115602.4003221-1-arnd@kernel.org> From: Guenter Roeck Date: Mon, 22 Mar 2021 07:14:12 -0700 Message-ID: Subject: Re: [PATCH] platform/chrome: cros_ec_typec: fix clang -Wformat warning To: Arnd Bergmann Cc: Benson Leung , Enric Balletbo i Serra , Nathan Chancellor , Nick Desaulniers , Prashant Malani , Heikki Krogerus , Arnd Bergmann , Guenter Roeck , Greg Kroah-Hartman , Azhar Shaikh , Utkarsh Patel , linux-kernel , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2021 at 4:56 AM Arnd Bergmann wrote: > > 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 Reviewed-by: Guenter Roeck > > --- > 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 >