Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp28973imi; Thu, 21 Jul 2022 15:14:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ueGck1cKUaFKbJlzGpPeX4+PLd4fkPIrDukMYg71pdcBXJObjOwfNdYYdaxEXn5Xr2OvMu X-Received: by 2002:a17:906:a089:b0:72f:826b:e084 with SMTP id q9-20020a170906a08900b0072f826be084mr601415ejy.708.1658441644558; Thu, 21 Jul 2022 15:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658441644; cv=none; d=google.com; s=arc-20160816; b=WTTykuTU7O4iV4/LdsaglY3+zvhygZMTgcxO0q50GFZiLPJNi0b3UltkZ2Q4/eoTsl FjgpvbweeIlecYQko1iPuqZ1stba+6BwR+hlY9qoYqWtzDkSD3hiK8f3b19NCGiPq9lx CJ1EhyUuLTSczVqJABNeADIVIxFITgD/FuehiUxl6FHl0w109CdK/h0phjaUWre2yDtO NAytfA+E7Qs21TH5juRdCqCkkPq+J6G1v+kHjio+N11sqeKIaPi63G6Bfmdb+nZ73eK4 57IFr76bVCXhQ57aT5pqZ/aoPuyt3JiusZ0WgQquMDepbNdi+iNvhqgoZf12eLaExIRX UbsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LErnLL56nGm9lChykGIXw29HVqArQdrLygERQpVTY9Y=; b=lEoWStrIaZBe9v9xDaeK0gUQuV2n8pkzOXyyE/ObfMYjjw17ck8YYZQW/GMU9oMxrX n7cC87Fb+eD4Qr84+s8caiRv3VFz23sg5eOIfwKw11XwBjlqG0cA+zi4X+h+8+RoUORA UkRBFWheQwJKXt5bSgGjaDDviFuS4hG/IOn6l+CipQuP/gLagaXXyHHu3GUK+B95xfu7 +hLPD7k+LfnkWpOZYQLowEoxWtq4apTIWHqkIgvUSP8SUI3hD6Z036uhIEWT8gyeaq/8 PId7lo6chc4cZOZa4lkDqPT8QblT3rdjjKYbh1Jw5jr4fOMFPrJ9HBkv+GPtkfrvDB2c Ta2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M3DUY5Qp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j24-20020a056402239800b0043bcb538bbcsi1266149eda.250.2022.07.21.15.13.37; Thu, 21 Jul 2022 15:14:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M3DUY5Qp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233828AbiGUWFT (ORCPT + 99 others); Thu, 21 Jul 2022 18:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233557AbiGUWFQ (ORCPT ); Thu, 21 Jul 2022 18:05:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AE8C1276C for ; Thu, 21 Jul 2022 15:05:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 42E53B826AE for ; Thu, 21 Jul 2022 22:05:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D8B2C3411E; Thu, 21 Jul 2022 22:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658441111; bh=LvcuNeaTxV66PvKnmvNrKgBUF+QpgGrAAwxXDjh8JUs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M3DUY5QpK02B5dyP6VKhqCfc4Wprfy7PsekVgbT+uZHlTLs7zs2uMX6j8SYxYODmf fd6/BKLrQdUINwXFcRl5s4Zc5awICjOyBDCn8xtSE83tx8ms0DAoiZDDrdU0k2+ntX wcCHAnGpX38gTRGrucevYNxUma2oOdca5cxEY986qgQoGxHVHupu+eckJr1PAHFDGT 6a+TU9pgq6r/ynPe4h6HRluk5hQZf5BODrkCMnmXeRdvFXq6QTk9HLti5o5sFV9ANb GECQuhBZSwiVzeYGml/KmNhatDX1s8UZEfsdwZlWNrOo24NAaY4tUOVYNl8vhgKmyk FkP9JmivuHAWQ== Date: Thu, 21 Jul 2022 15:05:09 -0700 From: Nathan Chancellor To: Justin Stitt Cc: ndesaulniers@google.com, arnd@arndb.de, gregkh@linuxfoundation.org, keescook@chromium.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, trix@redhat.com Subject: Re: [PATCH v2] drivers: lkdtm: fix clang -Wformat warning Message-ID: References: <20220721215706.4153027-1-justinstitt@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220721215706.4153027-1-justinstitt@google.com> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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, Jul 21, 2022 at 02:57:06PM -0700, Justin Stitt wrote: > When building with Clang we encounter the following warning > (ARCH=hexagon + CONFIG_FRAME_WARN=0): > | ../drivers/misc/lkdtm/bugs.c:107:3: error: format specifies type > | 'unsigned long' but the argument has type 'int' [-Werror,-Wformat] > | REC_STACK_SIZE, recur_count); > | ^~~~~~~~~~~~~~ > > Cast REC_STACK_SIZE to `unsigned long` to match format specifier `%lu` > as well as maintain symmetry with `#define REC_STACK_SIZE > (_AC(CONFIG_FRAME_WARN, UL) / 2)`. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Reported-by: Nathan Chancellor > Suggested-by: Nathan Chancellor Personally, I would drop this; my suggestion was the cast, which we are not going with anymore. Not worth a v3 unless there are other changes requested. > Suggested-by: Nick Desaulniers > Signed-off-by: Justin Stitt Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > Reported by Nathan here: > https://lore.kernel.org/all/YtmrCJjQrSbv8Aj1@dev-arch.thelio-3990X/ > > changes from v1 -> v2: > * Use implicit division conversion with `/ nUL` instead of verbose > `(unsigned long)` ~ Thanks Nick > > drivers/misc/lkdtm/bugs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c > index 009239ad1d8a..48821f4c2b21 100644 > --- a/drivers/misc/lkdtm/bugs.c > +++ b/drivers/misc/lkdtm/bugs.c > @@ -29,7 +29,7 @@ struct lkdtm_list { > #if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN > 0) > #define REC_STACK_SIZE (_AC(CONFIG_FRAME_WARN, UL) / 2) > #else > -#define REC_STACK_SIZE (THREAD_SIZE / 8) > +#define REC_STACK_SIZE (THREAD_SIZE / 8UL) > #endif > #define REC_NUM_DEFAULT ((THREAD_SIZE / REC_STACK_SIZE) * 2) > > -- > 2.37.1.359.gd136c6c3e2-goog > >