Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp261954pxb; Tue, 15 Feb 2022 12:47:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEgt02uuz27BE4PZQ9q3HK63S/SuLSJndFrdhL20IIHW4sXUTyAtQk8lLQM9f59yOZOdn5 X-Received: by 2002:a63:82c8:: with SMTP id w191mr575876pgd.298.1644958038073; Tue, 15 Feb 2022 12:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644958038; cv=none; d=google.com; s=arc-20160816; b=dnqKB9GTtvJHGbe+Iw16K5NtHTPGYEE6Xy6DTsCFgs3iy7PbFXBVMxUGOQUJ9cv4zG nOVJFsxWxGmRt/kGyAmV94iOZw37ZXPI189Fl9p0HTyPniseYXWf05ApVyxWps1N+FCf KhoyjkmBPz9h+HGRelmfo+9C1VAfNduCSKi2eyqIgiRrpTyAAkrFbnzxJtsCeGxHx1vZ OzmnMpmNrRDr/ZclciPyzvk1/gCnF6qeaW0gMALZ/n3lnKjviAlejaVCce0j4bT3iG3g 6tFDsqZQYWtHMy4bfZaIK4UpzI97M6itMXcc7uAL+xXMeMxV6UyPy3TtgAEZKLcftcxI 80Vg== 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=3OT/knzmdzn6deC3srtpbJUEWzQmoaaXTERbGmjG3iI=; b=v3k5hYUx2TgHjRYuDpYcHTM6PAy46vcaShoZz/7TiW++R0Bfl9llMHJbFBvtXAlDMO kRLPDouMQzUuBNGIoTQ3cMdKILc0mYuA3GdnFAwl39NzOzv3nJynd09LMoLLcKQX1v14 BN6Os+tMqNAYazFtDFPyDhhQflDbnQ4/nb0vJZT2OZNCPSaDBxp/ftQe77dz5W1PXPvc tpD6hazlZbXrmUuv6n0GXaNB68mcBzNkj+bcaE8zDEQZqEiv0jqUiDe80nBDhD2SxG3T GqhQXw+/sHnIvyOouWVgLwIjAVEXmn9WTRN1aps1W0cAd4qQuJzAr+DHQHnoJvFFroLE sBJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KD1kgcdA; 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 bf17si4106864pgb.10.2022.02.15.12.47.00; Tue, 15 Feb 2022 12:47:18 -0800 (PST) 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=KD1kgcdA; 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 S243287AbiBOSxF (ORCPT + 99 others); Tue, 15 Feb 2022 13:53:05 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232855AbiBOSxE (ORCPT ); Tue, 15 Feb 2022 13:53:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB8DF7C14E for ; Tue, 15 Feb 2022 10:52:53 -0800 (PST) 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 83368B81B80 for ; Tue, 15 Feb 2022 18:52:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E49FC340EB; Tue, 15 Feb 2022 18:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644951171; bh=DFG0pRgxAXggFuC5nOBdDvexAUqfQBkCU3iOcuBDTLs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KD1kgcdAH5hIi1+tPUuj9hs1lQi/1mRkekyPB/HBDERBqSiPocLYx+7M+qFCRr1Nv 82kimfILqAA5HyP4LXAoI1u6y7aKJriuVzXe0db2jwIz4FfIS2QUkAtBPyM4HMcsZx oYcxOeF2h1/9I52noM8DP7kJQ7hZnD4K613ltTs/egGEPU5xdWfD9gMkXa6mWBXsb/ c2NOQcj+47/jdtoldgqMnRIu64DXzXzuhG6qEn5VHXsdU1U1qJRjitolMfLPTsFT6I 9XVm7MPeOX/xaMSZ7Em4Gve1jd3myWH/D472ERvQsyHbTG2nieE9JZUzOPvrlLnVIQ J0gJ8+132x8kQ== Date: Tue, 15 Feb 2022 11:52:46 -0700 From: Nathan Chancellor To: Tong Zhang Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Nick Desaulniers , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2] drm/i915: fix build issue when using clang Message-ID: References: <20220214195821.29809-1-ztong0001@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220214195821.29809-1-ztong0001@gmail.com> X-Spam-Status: No, score=-7.2 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,T_SCC_BODY_TEXT_LINE 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 Mon, Feb 14, 2022 at 11:58:20AM -0800, Tong Zhang wrote: > drm/i915 adds some extra cflags, namely -Wall, which causes > instances of -Wformat-security to appear when building with clang, even > though this warning is turned off kernel-wide in the main Makefile: > > > drivers/gpu/drm/i915/gt/intel_gt.c:983:2: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] > > GEM_TRACE("ERROR\n"); > > ^~~~~~~~~~~~~~~~~~~~ > > ./drivers/gpu/drm/i915/i915_gem.h:76:24: note: expanded from macro 'GEM_TRACE' > > #define GEM_TRACE(...) trace_printk(__VA_ARGS__) > > ^~~~~~~~~~~~~~~~~~~~~~~~~ > > ./include/linux/kernel.h:369:3: note: expanded from macro 'trace_printk' > > do_trace_printk(fmt, ##__VA_ARGS__); \ > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ./include/linux/kernel.h:383:30: note: expanded from macro 'do_trace_printk' > > __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \ > > ^~~~~~~~~~~~~~~~ > >drivers/gpu/drm/i915/gt/intel_gt.c:983:2: note: treat the string as an argument to avoid this > > This does not happen with GCC because it does not enable > -Wformat-security with -Wall. Disable -Wformat-security within the i915 > Makefile so that these warnings do not show up with clang. > > Signed-off-by: Tong Zhang Given this is not enabled for GCC and it is disabled in the main Makefile: Reviewed-by: Nathan Chancellor Additionally, it seems like trace_printk() is designed to be able to take a string literal without a format argument, so this should be fine. > --- > > v2: revise commit message > > drivers/gpu/drm/i915/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile > index 1b62b9f65196..c04e05a3d39f 100644 > --- a/drivers/gpu/drm/i915/Makefile > +++ b/drivers/gpu/drm/i915/Makefile > @@ -13,6 +13,7 @@ > # will most likely get a sudden build breakage... Hopefully we will fix > # new warnings before CI updates! > subdir-ccflags-y := -Wall -Wextra > +subdir-ccflags-y += -Wno-format-security > subdir-ccflags-y += -Wno-unused-parameter > subdir-ccflags-y += -Wno-type-limits > subdir-ccflags-y += -Wno-missing-field-initializers > -- > 2.25.1 > >