Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp942859pxp; Wed, 16 Mar 2022 22:07:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgi5NxBTsapOIFPRhre3SUOQOIb6n2S17PTdboUUj+My+ZCmOB3ey9FOXwIKfnavYuuIfo X-Received: by 2002:a05:6a00:140c:b0:4e1:530c:edc0 with SMTP id l12-20020a056a00140c00b004e1530cedc0mr2737659pfu.18.1647493633801; Wed, 16 Mar 2022 22:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647493633; cv=none; d=google.com; s=arc-20160816; b=AVezrbDngTyCKIpJFUL1EpRD79U7MS+BsijnvmuHAITNQn5G6w2+FmQNKNHPp3jOFl kFHSCQN7j+E6HyV0ZlsMZljklLmf+JRaPjKF5wt5E4A8e7HPaDs5crYSPXCesQrhAlWU +4MNJeB01wxhVJd3L++tYBvWon3DvxkbdCpDKiYY+QhMG9Mvj3WtdEwsFdJQaurNVpVt F/RsTZYtbVoHtZxHK8YyR3A2MlNo6xGfA5UX96xPbgLa8IuqHAJmiOXJz9oM0a7qW9L/ jLyUGMNhpVBIujr6Ox8sZmXoc6F1D1Zw40SscekqNnHhv/uDk4woOz2Yrr9PfsoEWnDI Wvww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=DuIs8YDVZ+FUMK/eJrsH1Ol6kQ1ErHXTTPKm8dwtCDY=; b=edtzQPSWLnVxFU/8ln/Cl6FcaciIE3Cfvfoszv9RkPDCT5EsenLWQ1nkub1fOXiMbi rboz+q4C0POPuMpGPl9Sboj/tuIt/z5R7p4jbQtgp6Pl+PTarOR3661YnwDHj6LJ7Cwu yju4l6c4RGe3XRawKSDcRV6O8RbxFzYg4WjwFKioxcxmYfDyTTk8KrUwVH5OL4XYgNlg MKnCDvI2Kpl/ojqKWC9xVJIjl3c6p4WFllBIPaoUkmw+Y9gzod0sV2H/KP3BWIe9afSk dHVLav4bqTot7/kvAqsQwU1l3WaOCKvmAVXE+Lho51TROu2LRtmSM50R4gRnLWDlPz+E bMNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qFM55vPP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l21-20020a628815000000b004f6ce893677si3395422pfd.238.2022.03.16.22.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qFM55vPP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A5BE31B84E6; Wed, 16 Mar 2022 21:18:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358152AbiCPVdz (ORCPT + 99 others); Wed, 16 Mar 2022 17:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358166AbiCPVco (ORCPT ); Wed, 16 Mar 2022 17:32:44 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7310F2AE2F for ; Wed, 16 Mar 2022 14:31:22 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-2e5a3c1384cso24935267b3.4 for ; Wed, 16 Mar 2022 14:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=DuIs8YDVZ+FUMK/eJrsH1Ol6kQ1ErHXTTPKm8dwtCDY=; b=qFM55vPPyVaTFZa6kKJVrPMllDMUjRNpqwlMmOmDcPlqGqlZnRgFm90OQ/CO08cIMI ozQ/bQaFkgY6tBLchUOHwG5cpuV7XQUp3DlFqSxMoJeo9HYsXFotdyInje2ISR96cYQN LM45pBenpgqvAz7wiBXGrQYNTwXSy3N/8foxmJA9QcViS2Q9E6oQbYNGbEyzrl3kPKe5 Vdth5nPe7IUQq+DLP6KJoLdgGYAdZGyuoOQivb0qDhbjrTGKvlrUlVSe4MOpDj6YjYSZ sglDm0vtSzTiuyLqNmx0vUupCP0818ajsmD+wSomc8LH3tydX+mZ9Y7CoJJyg/Og5Y/P i6PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=DuIs8YDVZ+FUMK/eJrsH1Ol6kQ1ErHXTTPKm8dwtCDY=; b=26TL2v7eTDIiyhrItR/qyghCtW/963OjvWypf7kzjoimq2RmbADSqgTB8e7N4fXvEA 7VlKXFHBIeld6mClK5YL0d3At2E0QyUjbuwS3MAo3SyDuZj6beSe1aVmdUhvuB+sjZVj 4nL5k+I4ZwpEXF3uP4FJsbdl9BUpN74WBbqoyMqN0tnZExykhQt4nKDrITIv3tzozG8A FzwciKAOcOPVB3V3C1gxlC6YZnqJPU8I6+SqYONvExtOrUZ+/AxH083gonz9LsNIdAAZ 0gxKmDSqn3XCR+p18I8BlLaVmZ1lG6RHhm7t96qQFsP8wFaNUt9dG/xri8KIXYV+wcaB 3FjA== X-Gm-Message-State: AOAM530JL3rspRZ6z7xEQb4TLFd/lgL3na4CyZQOBX+1fFHeVRSnf5p2 M/XfSOhU0xjIgF45nufculwiutOo X-Received: from fawn.svl.corp.google.com ([2620:15c:2cd:202:7dae:6503:2272:5cd1]) (user=morbo job=sendgmr) by 2002:a0d:d50f:0:b0:2e5:bada:3948 with SMTP id x15-20020a0dd50f000000b002e5bada3948mr939764ywd.314.1647466281406; Wed, 16 Mar 2022 14:31:21 -0700 (PDT) Date: Wed, 16 Mar 2022 14:31:18 -0700 Message-Id: <20220316213118.2352683-1-morbo@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.723.g4982287a31-goog Subject: [PATCH] soc: qcom: smem: use correct format characters From: Bill Wendling To: Andy Gross , Bjorn Andersson , Nathan Chancellor , Nick Desaulniers , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Cc: Bill Wendling Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When compiling with -Wformat, clang emits the following warnings: drivers/soc/qcom/smem.c:847:41: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat] dev_err(smem->dev, "bad host %hu\n", remote_host); ~~~ ^~~~~~~~~~~ %u ./include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err' dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ ./include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ drivers/soc/qcom/smem.c:852:47: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat] dev_err(smem->dev, "duplicate host %hu\n", remote_host); ~~~ ^~~~~~~~~~~ %u ./include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err' dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ ./include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints. Link: ClangBuiltLinux/linux#378 Signed-off-by: Bill Wendling --- drivers/soc/qcom/smem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index e2057d8f1eff..a98b5f395d15 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -844,12 +844,12 @@ qcom_smem_enumerate_partitions(struct qcom_smem *smem, u16 local_host) continue; if (remote_host >= SMEM_HOST_COUNT) { - dev_err(smem->dev, "bad host %hu\n", remote_host); + dev_err(smem->dev, "bad host %u\n", remote_host); return -EINVAL; } if (smem->partitions[remote_host]) { - dev_err(smem->dev, "duplicate host %hu\n", remote_host); + dev_err(smem->dev, "duplicate host %u\n", remote_host); return -EINVAL; } -- 2.35.1.723.g4982287a31-goog