Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFCA7C80 for ; Mon, 14 Feb 2022 19:59:03 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id v5-20020a17090a4ec500b001b8b702df57so278120pjl.2 for ; Mon, 14 Feb 2022 11:59:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O9KHV0/N+Gfd1GRgecao8wegxCnC38XHEZ75QGyEISc=; b=hosVhwFvGBdDFJM59PwgE1Wy9Oe3mkF9MnrGUFJ9FoiCAhftxx37tYIU9SOTBqcsD7 wsSPNn3E0BoWvjzNAhs6aGwTAJpIfmq3ajNXqAsN6l9CR21k7REe7ZOUYKwd1ydYLUoC rI1fJy9gv3Jjz+5gQMh75lP41vSXjq/5PKYCvS9PPjL7bfHFKLInVSA9KdF4baDlCGcF W6P6zMRghtpvPi7xln6B39B/6mywe2eEhYl9L6bUnwoy0DxEN70P9DLeKGLpmwLmQiu/ Ji5pdoom7+afBUJqEBm0RoPL4YBYxTGYzj2lmXtkG1ptnEHTAq5yfWaxNmDLkNFb4pyX 1Sfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O9KHV0/N+Gfd1GRgecao8wegxCnC38XHEZ75QGyEISc=; b=31aqmcGQ+tF2Wx112e6kiIT3wOp6FVy1xunic/MDVNxRgGuVbzwBugfj+AdwYGvB/y AgxojMo3v0jwMdPZlw/PXIDcjm2DaoSPi3tVLzc9wgAxQYcgMHToPZ5CMTuaoy7WbTMl 3izI7uB7RatQq9boGhWm+HNHRITKcn02Xd6xueKV/JPHCMRyUcKqjeoNWNV6qTR5y/gI heABmkUyMj9Gvg9UK11s28TOHIhK41W2coE3deX/V5ZvyIGK9lzeV8bYzRWOeD3pESgR MjetC9w/6ePgS8BGzQxeQt9Pl95jJSt+6D/6LxiO+3vhjmE/oMWri0LBuVRRx79+Ve8D 2EXQ== X-Gm-Message-State: AOAM531h7UdyqW1BPFK1StXmppsn6j9UlDLS1SW4TM6iunzezpd5w5h9 T3yehzrVdzwfNVZ7pYYB1oI= X-Google-Smtp-Source: ABdhPJzhIOI72ps9ZuG6CEVrnqdXFSMazidGQ6xcG6wA+W2GqdMXI1JFgJBqpJ/chzdS9CFqPj7wCg== X-Received: by 2002:a17:90b:4d84:b0:1b9:4109:7118 with SMTP id oj4-20020a17090b4d8400b001b941097118mr263383pjb.119.1644868743175; Mon, 14 Feb 2022 11:59:03 -0800 (PST) Received: from tong-desktop.local (99-105-211-126.lightspeed.sntcca.sbcglobal.net. [99.105.211.126]) by smtp.googlemail.com with ESMTPSA id v2sm14663291pjt.55.2022.02.14.11.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:59:02 -0800 (PST) From: Tong Zhang To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Nathan Chancellor , Nick Desaulniers , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Cc: Tong Zhang Subject: [PATCH v2] drm/i915: fix build issue when using clang Date: Mon, 14 Feb 2022 11:58:20 -0800 Message-Id: <20220214195821.29809-1-ztong0001@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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