From patchwork Sat Mar 8 02:10:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 25914 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1D67203C3 for ; Sat, 8 Mar 2014 02:10:54 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf18957915oag.8 for ; Fri, 07 Mar 2014 18:10:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ToBmbeOwONg0yq9kIQNEVi3YWfLW9acuAxVTSHT3ZEE=; b=IoKiwrGkZ4+OcOq+nb86ZUWbHj7xzzNkfkzUIWWvuizrhdxHkGaluFpkY39VpaJcMn vuJfg0GFpj3DMNGC3y2EEF02eOkAIwAamEOye6hLtbACyVQD8Dd+xAKNw2vA2ETBDBLI /74fbOeiEJmdL3K+mlA0MyhOp4sY1DofiE18PVomk+bxCymBXv0WcSrD+EaNJ7FQOc0x m2Sxuc/UVesgc7q7zx31OXSecLiF5QVE5ZFsLLjGjTit1rQgWpLpUFu45WzdWCdvooVy VUAa+jZzmIu8Icoxn9unSr54Gn8xN9XgQ5xgaQxAWLP9MSH30X2Zj25D9bcooyZrP3za 04hg== X-Gm-Message-State: ALoCoQmlaceEE1NqDukYd2Hr6sa2B7vtIV+MHVUiO+q5BN09LHExgiv5ckdduMpiglkIbkVX7OtB X-Received: by 10.182.108.136 with SMTP id hk8mr9531424obb.11.1394244653196; Fri, 07 Mar 2014 18:10:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.136 with SMTP id 8ls1356768qgh.43.gmail; Fri, 07 Mar 2014 18:10:53 -0800 (PST) X-Received: by 10.221.26.10 with SMTP id rk10mr12926440vcb.0.1394244653018; Fri, 07 Mar 2014 18:10:53 -0800 (PST) Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com [2607:f8b0:400c:c03::234]) by mx.google.com with ESMTPS id sw3si28992vdc.24.2014.03.07.18.10.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 18:10:52 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::234; Received: by mail-vc0-f180.google.com with SMTP id ks9so4836025vcb.25 for ; Fri, 07 Mar 2014 18:10:52 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr12860718vco.18.1394244652851; Fri, 07 Mar 2014 18:10:52 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp156176vck; Fri, 7 Mar 2014 18:10:52 -0800 (PST) X-Received: by 10.66.192.162 with SMTP id hh2mr25530499pac.150.1394244651818; Fri, 07 Mar 2014 18:10:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si10077348pay.20.2014.03.07.18.10.50; Fri, 07 Mar 2014 18:10:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752186AbaCHCKf (ORCPT + 26 others); Fri, 7 Mar 2014 21:10:35 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:57669 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbaCHCKe (ORCPT ); Fri, 7 Mar 2014 21:10:34 -0500 Received: by mail-pa0-f52.google.com with SMTP id rd3so4963992pab.11 for ; Fri, 07 Mar 2014 18:10:33 -0800 (PST) X-Received: by 10.68.34.197 with SMTP id b5mr11767671pbj.16.1394244633509; Fri, 07 Mar 2014 18:10:33 -0800 (PST) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id fk4sm18201531pab.23.2014.03.07.18.10.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 18:10:32 -0800 (PST) From: behanw@converseincode.com To: khali@linux-fr.org, rostedt@goodmis.org Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org, dwmw2@infradead.org, pageexec@freemail.hu, Mark Charlebois , Behan Webster Subject: [PATCH v2] module: LLVMLinux: Remove unused function warning from __param_check macro Date: Fri, 7 Mar 2014 18:10:23 -0800 Message-Id: <1394244623-25623-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <531A73EB.6060403@codeaurora.org> References: <531A73EB.6060403@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (bad format) header.i=@converseincode.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Charlebois This code makes a compile time type check that is optimized away. Clang complains that it generates an unused function. I believe GCC won't complain for a static inline fuction but would if it was just a static function. Adding the unused attribute to the function definition removes the warning. This code works for both gcc and clang. Signed-off-by: Mark Charlebois Signed-off-by: Behan Webster --- include/linux/moduleparam.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index c3eb102..7f2a726 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -346,7 +346,7 @@ static inline void destroy_params(const struct kernel_param *params, /* The macros to do compile-time type checking stolen from Jakub Jelinek, who IIRC came up with this idea for the 2.4 module init code. */ #define __param_check(name, p, type) \ - static inline type *__check_##name(void) { return(p); } + static inline __always_unused type *__check_##name(void) { return(p); } extern struct kernel_param_ops param_ops_byte; extern int param_set_byte(const char *val, const struct kernel_param *kp);