Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2291660pxp; Mon, 21 Mar 2022 16:04:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKlJhMSsd/1/8Dx9SMzo8ERPEZIwS76oyJsa2kDCsjXkgwKYGo1YRIS3cSHENzPhESteeU X-Received: by 2002:aa7:8c45:0:b0:4f6:bf82:7aba with SMTP id e5-20020aa78c45000000b004f6bf827abamr26309161pfd.20.1647903858500; Mon, 21 Mar 2022 16:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647903858; cv=none; d=google.com; s=arc-20160816; b=IKyavg0aY1Hqk3uJVsKsuITr+hUMHp7ddXqhLPxq5/CKqc0B2ZBsYgaqcDuJ7CH1rR MJ3eYAvuYVxtaR/kq9LAuOq5iSOwVyra0BoT+byLo1UbJbEoOg26WCJzg+mrWSNN7ZyQ 8snjtf0NphfUfFKPhkQwoBeYrQUp2zPq+4Aql8eAA4Jtt1lEUuTWmQEM2JTx+1oT25xq BpBaDvCOhLRGY9um8RtLHiJDKggNKWXLdATKlsx3UOpxHR/HeLF05raFEF73JjEE88OQ tr4Xjid3TLvGZNrE6lp/b+t+la2P9R97wFU4qqMDPGWHB56dXiijPn/3pm9TUiMWdKDT Uahg== 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=Xm/AHZsJfo4Q5m1ZRbKY9ffQNuxs1oV6xRmfufFjoRM=; b=a5S6v29JGM+1cLzD4mjKmM1j/d4E8c/5sW4udg/8EnbnE1HpX9av7B19DotT+0A7uD I6EOHZLfCLtgIINOUibLMCKsQRb7OkLwC+/K9kWyN8AjRSFWSTIuvA/nVR0982T+YWFH CZjOqXkdKo6kooLvmlV7vTWrXGnDlYXcJ/lBSC3to6HjrmAsY2eyS5CVhUqnJ/McGVpp fOwAXtZ/Sntai3cBy3s5pnrPaqsMpAwiQcNd1vhDYcz75FSB4Ae1qWd5Qr2HrUO4Y+GN IO3+7OvxpxSF26edFWbMtVvbRnbTkczQIsYPilz5Xs3X4o4QMaOvTKYc6FyDpLeTYXkD IkMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kNS6QJmK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id x5-20020aa79185000000b004fa3a8e0038si8434509pfa.239.2022.03.21.16.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:04:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kNS6QJmK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 CEAB941262B; Mon, 21 Mar 2022 15:03:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351168AbiCURvz (ORCPT + 99 others); Mon, 21 Mar 2022 13:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351031AbiCURvx (ORCPT ); Mon, 21 Mar 2022 13:51:53 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68382387B8 for ; Mon, 21 Mar 2022 10:50:26 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id e6so10809154pgn.2 for ; Mon, 21 Mar 2022 10:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xm/AHZsJfo4Q5m1ZRbKY9ffQNuxs1oV6xRmfufFjoRM=; b=kNS6QJmKh3GO+IfuqJ35qyUf9JvT2eE7gGsUF6fEL6OHfBxNZnORHfHg29dMmTdk95 h3yiaRr59guCVWMl/g5HStYr01LJk7VAvcFH0Uo7S3GHl0HFjQHY0VpWHU0HA3pouvPQ Ax4v+5z30lwLZJLPotdz1U8/OMCRtt1IxORyMZXni2ammgU0hXufdgDPNyh8oZqZHZn6 GhX9XX+enV4kie3xxhpTaYB7uS8guxq+DlZ6mLhfU11QMiuTJatqRPce7LB684VHQ2nD bYumzEQ5N2fzoTh5muqii5dUbgqgkoUW0WDbxREVA7vZjhYGbRQgvBQ1jaMMTzVqFblI /GEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xm/AHZsJfo4Q5m1ZRbKY9ffQNuxs1oV6xRmfufFjoRM=; b=FmUfRUcdoQ2sUGMcM/ogd3J0tdwhpJ5uhACLAjohMiBNUUnkcVWFnBZApy0JeAUgOC qhnDnn7EuxRW3xqAgGwCVpDZkWAkrGKWVHvtH/zBxQ3ZRNs9BKqNzxU9Gc9yffg9AXiB 33bBaL1k6CVRZga0ZhlnCfLGb4Idy+n79c5HGe6SDbp8d3j3Ox+QnoXpVVUfqB1GQXj9 sxD1Lx9505wA4I2EQpOYcfp6a1KDA3mbesHkGD5mqPp9neartukxL/fhsZgTG5XKuL7m Lf+EFntkDfQn10dMaIjj5VYih6ui5Nk7EKm53lUiURpg9bzMQN2TGHRHDqcb406O+yLH NKiw== X-Gm-Message-State: AOAM530yxL7GbwU+ewUP4AnZaq/N1mj2cZcC3k58LHVbVjz8EKNaeBNR 90DrpnSnlGWobtZtu+VMZq53KHIOgUZ1+6NvViADZd88lw== X-Received: by 2002:a05:6a00:14c7:b0:4f7:4553:c06e with SMTP id w7-20020a056a0014c700b004f74553c06emr25059646pfu.45.1647885025646; Mon, 21 Mar 2022 10:50:25 -0700 (PDT) MIME-Version: 1.0 References: <20220316213118.2352683-1-morbo@google.com> In-Reply-To: From: Bill Wendling Date: Mon, 21 Mar 2022 10:50:14 -0700 Message-ID: Subject: Re: [PATCH] soc: qcom: smem: use correct format characters To: Bjorn Andersson Cc: Nathan Chancellor , Andy Gross , Nick Desaulniers , linux-arm-msm@vger.kernel.org, LKML , llvm@lists.linux.dev 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 On Mon, Mar 21, 2022 at 8:24 AM Bjorn Andersson wrote: > > On Fri 18 Mar 13:27 CDT 2022, Bill Wendling wrote: > > > On Fri, Mar 18, 2022 at 11:02 AM Nathan Chancellor wrote: > > > > > > On Wed, Mar 16, 2022 at 02:31:18PM -0700, Bill Wendling wrote: > > > > 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. > > > > > > Right. Alternatively, remote_host could be turned into a u16 to match > > > host0 and host1, as those are the only values that will ever be assigned > > > to it, which should have been done in commit 13a920ae7898 ("soc: qcom: > > > smem: a few last cleanups") to avoid introducing this warning in the > > > first place. > > > > > I'll be happy to redo the patch if the maintainers wish. :-) > > > > Forgive me, but I think that not mixing the unsigned int and u16 would > look better. So if you're willing to respin this to change the type of > remote_host, I'd be happy to merge that. > Happy to do so! I sent out v2 of this patch. (I didn't mark it as "PATCH v2" because I forgot about that. Sorry. :-( ). -bw