Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1621486pxp; Thu, 17 Mar 2022 12:56:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZvaW1tQ44xoORnMXOHqoGrvkTpd6uIR4HwaJQCWRiSNofPQTqA8ri3ocu7NA0skVTjAQJ X-Received: by 2002:a65:674b:0:b0:381:6565:26fc with SMTP id c11-20020a65674b000000b00381656526fcmr5005387pgu.618.1647546965003; Thu, 17 Mar 2022 12:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647546964; cv=none; d=google.com; s=arc-20160816; b=AKk44cWFfiaveNuDnW8C7gpWn+XKKh0RjiUZ3K22reuYhf8rC7FzhVtz1VSWn3bu5X WDqYSDxSiaaMz5z3e91X59wJuq74CdmwQ4YIcaXJXUS4MTwbWViJbwfJXau9oMNDLNhD 8E6XDIpa8SnLyI1HptR7Wd616bwPluu4yrx3o40w5eg6sDdIn13/timqJXRyHzzS3pUG BUCKpGvTiEvTliQ/cwZXBKrmPmuruK04DGronZFqZWn3jI+3efbBp8u42iogk7a1Hs1D aKwlg+Jl49M+KCQ3UpK4roKMrQUKAUXr1WQgxbhHLei5xprnG+dCqvpgBtgPX+Vv/m1i 6Bzw== 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=GvRtkI+aajtqCy2c1b2F4MUYD+uMLWJPyiKwyzY7fBQ=; b=FAYP+l1tFUU+kB5SpW1zFLT2iyYelJtoowI23y/tVyxR6Ts4+xSwJH3W3eiOiES0gC tKFHLF9j+hQCgivqM+rS8PML6kLHxzyLVTku1DK0UFXc2e1bt5rVUG8uBbpkyy6vm93Y VrMKDx66u/mfqmPeLCtbHsNY1IhPGx5wPF9OESP3fqRmqvUF8DFf291j/II/tjkEvZiz 6BkIPPhd3Gv5yGtUIXU9kBPtwXDjiTClbgNkQ88mu6QPxcXoSY+PqTxLlyKy67Z4tFQB v2euZH/fAfshCXouKHjnef5K9eADTepQ2L3T4pd4m2mCdV3Qbte3jFiVWgHfEcD4Jy/T QoqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hne5dkL1; 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 a2-20020a630b42000000b003820b4fb922si2151093pgl.56.2022.03.17.12.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 12:56:04 -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=hne5dkL1; 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 E9A652662F3; Thu, 17 Mar 2022 12:50:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237319AbiCQSNR (ORCPT + 99 others); Thu, 17 Mar 2022 14:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237296AbiCQSMx (ORCPT ); Thu, 17 Mar 2022 14:12:53 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E29E21A8A2 for ; Thu, 17 Mar 2022 11:11:34 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id r22so8339079ljd.4 for ; Thu, 17 Mar 2022 11:11:34 -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=GvRtkI+aajtqCy2c1b2F4MUYD+uMLWJPyiKwyzY7fBQ=; b=hne5dkL1r66jaWeZwLdqsQWeaYzLA0jCNqUeaPeX4MK0bcpogrmJFtTsAHSYPHTv37 F31NNlIDn9bslKYtcs9T7Ma0331NI3pAKkY7Smg4Njyl7fKErwUzZLR77VAJgDJGt60n 8yoAF2gzIx0ez9xH7e1/L5DkEJjrMCAG7htDNgWR4IVaW+tvIGLmwLqztCBKJVgv8JNg 9J29bhh2X/xEUKQYCshpyqmTT6OTC0cbzKTXSYQzOMHmhryjwsJyMrPUTkPxAl/m9Ng8 HHfV7rzkYosyidu3QWTr29KI54SAqAdUXPgypkWcpypqbuGZSPra+xml3A+fuJpxtgBF iU+g== 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=GvRtkI+aajtqCy2c1b2F4MUYD+uMLWJPyiKwyzY7fBQ=; b=7P2lJvBcia2pJ0z13ErEOaU0DFko2ocv0bw74WCHmC+HMo6GJnmGkHn4MUlqZsCBUu 5BA4ZlC6Yj/pRpzUheHGnqpoLsHNFqHd3F6zK23yOptxCPscB/GqwbChm/DOkCtuYiX8 cfcoJfjL1ayYYXVWSF4jNnmd4tnTcxQ9tS6eExwQyPxnPfRA+Jh6+z6+94sT5Mnb7aiK PG8b4JiSvJgostH68C97OSBXd3l8hr2x9sQjNYc1kjBnwUEHvwwbjQ2lQNugvoalkUbU UoGabzKkDlMI9BW23B1XLKG7G+Xm6iehBiTK+zYtW4j0/x6CeDLqaugvyVZd2wuF9jzM krRA== X-Gm-Message-State: AOAM532jtq/CP08pZio9awq0w842p2cinWl0dC0hAbyPkNHZbZI23phI Qr+GZqHytGFNSasT/1jq5WJGZKgLrvrqm0kf/gFiPw== X-Received: by 2002:a05:651c:1791:b0:243:94bd:d94c with SMTP id bn17-20020a05651c179100b0024394bdd94cmr3596248ljb.468.1647540692501; Thu, 17 Mar 2022 11:11:32 -0700 (PDT) MIME-Version: 1.0 References: <20220316213055.2351342-1-morbo@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 17 Mar 2022 11:11:21 -0700 Message-ID: Subject: Re: [PATCH] gpiolib: acpi: use correct format characters To: Andy Shevchenko , Bill Wendling Cc: Mika Westerberg , Linus Walleij , Bartosz Golaszewski , Nathan Chancellor , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Thu, Mar 17, 2022 at 2:07 AM Andy Shevchenko wrote: > > On Wed, Mar 16, 2022 at 02:30:55PM -0700, Bill Wendling wrote: > > When compiling with -Wformat, clang emits the following warning: > > > > drivers/gpio/gpiolib-acpi.c:393:4: warning: format specifies type > > 'unsigned char' but the argument has type 'int' [-Wformat] > > pin); > > ^~~ > > > > The types of these arguments are unconditionally defined, so this patch > > updates the format character to the correct ones for ints and unsigned > > ints. > > hhX specifier refers to unsigned char. It's a bug in the compiler. > > NAK. Andy, Our goal is to enable -Wformat for CC=clang. Please see also: commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") and the lore link it cites. https://lore.kernel.org/lkml/CAHk-=wgoxnmsj8GEVFJSvTwdnWm8wVJthefNk2n6+4TC=20e0Q@mail.gmail.com/ (I saw your follow up; this patch is one of the less controversial ones though since the types are not ones that are promoted). Bill, I just remembered that we will want to explicitly set -Wno-format-pedantic when enabling -Wformat. Remember that -Wformat is a group flag that turns on other flags, such as -Wformat-security (currently disabled) and -Wformat-pedantic. See also: https://reviews.llvm.org/rGcc01d6421f4a896820c02da2ea92b82d973b431e commit a8735821d198 ("Kbuild: Disable the -Wformat-security gcc flag") It may be helpful to cite commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") in future commits that change the format flags for types that are promoted. -- Thanks, ~Nick Desaulniers