Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp479915pxb; Thu, 17 Feb 2022 08:06:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbBRBV6ld3gWaohvmptFGGmA8knCPzh07JGtbi8vWohXhd394RcVrv8nXwRKNi/l13qJIf X-Received: by 2002:a17:906:af79:b0:6ce:61d3:7e9b with SMTP id os25-20020a170906af7900b006ce61d37e9bmr2937359ejb.191.1645113984390; Thu, 17 Feb 2022 08:06:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645113984; cv=none; d=google.com; s=arc-20160816; b=iCDI/Vh6UfqD2CLmTYRMzh7ojJQQNuR2zwk9pJKBYwGY0MhM8r0BKf3NSpxvIEPw1p BOusE+AjQ9oT9h9+KgNlFraq1Jeo/pZOBOZPGQqTnLXWA8xiBXw0/HN/rYnzzoVgoJqA QLp48cwcfOZd5UHhHagGTKBFRQr4Dy3/cuFO+EU13jtr0bEWjRj4yLaL6iutaVWTM5nZ opE/vkyfZcxaTsan8+5Y+siFC54beoeOS+WWALM/fDUVHCjqcaF7DVQ98NwxqbdNKna6 mIxtA/VRp1OLR7pt3IgvYKknxBGcOzlZmW8aKqRQwKD6tVuFzq2ThRybs7t1hhlIJSFI GblQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=gaOOdCpKjuGv/Vd6s3YCT3vRVObz8XStF74DDP3HOUQ=; b=VoteHgVJnauKdehg6aPYIWiTl4FWIpdLKwsEnTyvnYJNd7oLvS7U4Tr6jf0/uWfucq cxRP5w/JapvR/MWQFLHtP40qaSjU3l6oHFkMyVfAs6BnRWz++gy/OW7xxl4fMf5eSclY toAANk4ic1JH3UivpxGVrAed0B9sp4dQvU3dfG/COL7G8DKFJdNMYI+zvsqYuiKYkTcV LLpiNcUnkGhEhbZCB+Q3a85pOSWsfzDT0nmp3qNONJloC088zDqpZ8vcydUA4439B8oO 2yKAYZCqi5JkwM69FlOcaYHhy0zDdWAir4bS0LJnA/M8vtW9y6XVxMNr061xgjkEmCGu noUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=evx+9DmK; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8si3779570edt.652.2022.02.17.08.05.21; Thu, 17 Feb 2022 08:06:24 -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=@intel.com header.s=Intel header.b=evx+9DmK; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236543AbiBQHs1 (ORCPT + 99 others); Thu, 17 Feb 2022 02:48:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234942AbiBQHsZ (ORCPT ); Thu, 17 Feb 2022 02:48:25 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2424523A1BC for ; Wed, 16 Feb 2022 23:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645084092; x=1676620092; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=99+dhgli+TBsASZWY8Mrl5qU4Lz7MyY/5DzeBpVia5E=; b=evx+9DmKQConkhRgTM5wiRPj4U6ymAwK3G6SvzhJMgGAMu07pnTHXGWs qYYVIwDFk0bQ9N+ezerLKLhb6Eq/83HXLAKypOmLuOnX5NwQ1sZlOkK7K oxWbjiylGxJ2O+QKrn3WG8Y7lODkrGgIDMXVIQ4SrVMW+KQbx9vwxRb+y 9sWpRLOj0AzL7oYqYnXz12wagItn3kH/6cnRunpSbNtVFkfSc3ixPnoCO EQdKugIBBibCoV4yYsqG7PvBPxgP+UModkS/uUPCVPOCpQgTef74Nu91O vGr4/MNEAN6gFr10gmsNdQYdigllVIY7VlyfADaxyUXIMlSK/KB8bahk9 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10260"; a="249652808" X-IronPort-AV: E=Sophos;i="5.88,375,1635231600"; d="scan'208";a="249652808" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 23:48:11 -0800 X-IronPort-AV: E=Sophos;i="5.88,375,1635231600"; d="scan'208";a="636953141" Received: from acushion-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.21.45]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 23:48:07 -0800 From: Jani Nikula To: Nathan Chancellor , Tong Zhang Cc: 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 In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220214195821.29809-1-ztong0001@gmail.com> Date: Thu, 17 Feb 2022 09:48:04 +0200 Message-ID: <877d9u3pe3.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 Tue, 15 Feb 2022, Nathan Chancellor wrote: > 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. Thanks for the patch and review, pushed to drm-intel-next. I appreciate the support in maintaining fairly strict warning levels in i915. BR, Jani. > >> --- >> >> 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 >> >> -- Jani Nikula, Intel Open Source Graphics Center