From patchwork Fri Mar 7 19:08:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 25896 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3FDE9203C3 for ; Fri, 7 Mar 2014 19:10:52 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w5sf10308899qac.4 for ; Fri, 07 Mar 2014 11:10:52 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=pezQlbv5J2nbAcpm5wEIp7SVsYAqR9Awo+LNphe03eQ=; b=aTL0dAsTiYxpTknQmqeQYCzPQFNLRJ+w+Fe4IVjtXBzZCW6dqx2hSMYYzczILpKXB3 nVa395PPVJbEUYOftbd+Bw1vqSBmWJZo8uRJ+Ty4UGjdHfc33cNeFgdedf7n4vqkvOei ruTujbv2F0BHD2/iw97zM2HZHO1f6EEVZaTgdLyMGqLKq9zbN1bYYN7qIDJM90nuWdWu T69pMWDsifw4SG0qsGyOXiVitUiPwiuqEaS9mQ8I5jnHtGqAXp6qT2s5dg+SOt+ITnhw x5jVAKR7HiWNkA5ajt4fp9Fl/tOKPQ5yYFlCmxjp/Iiiz1QTfVEjjrAvHDMtjgUoHIpc 2J2g== X-Gm-Message-State: ALoCoQl5V970wiW2En8EI5ATXbDIQyFYPeuTObtQZ1mv+DCHcUG6xUfUMw+6h3KLxAORNPc3xgzN X-Received: by 10.58.253.33 with SMTP id zx1mr6219948vec.10.1394219452662; Fri, 07 Mar 2014 11:10:52 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.162 with SMTP id w31ls559520qge.26.gmail; Fri, 07 Mar 2014 11:10:52 -0800 (PST) X-Received: by 10.58.106.134 with SMTP id gu6mr1103858veb.44.1394219452491; Fri, 07 Mar 2014 11:10:52 -0800 (PST) Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com [2607:f8b0:400c:c03::22d]) by mx.google.com with ESMTPS id tr5si3073467vdc.39.2014.03.07.11.10.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 11:10:52 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::22d 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::22d; Received: by mail-vc0-f173.google.com with SMTP id ld13so4500990vcb.4 for ; Fri, 07 Mar 2014 11:10:52 -0800 (PST) X-Received: by 10.52.81.66 with SMTP id y2mr13164773vdx.23.1394219452394; Fri, 07 Mar 2014 11: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 i9csp136448vck; Fri, 7 Mar 2014 11:10:51 -0800 (PST) X-Received: by 10.68.239.10 with SMTP id vo10mr24274183pbc.48.1394219451490; Fri, 07 Mar 2014 11:10:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wh10si9212821pab.278.2014.03.07.11.10.50; Fri, 07 Mar 2014 11:10:50 -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 S1752574AbaCGTKn (ORCPT + 26 others); Fri, 7 Mar 2014 14:10:43 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:60608 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbaCGTKm (ORCPT ); Fri, 7 Mar 2014 14:10:42 -0500 Received: by mail-pb0-f44.google.com with SMTP id rp16so4549753pbb.17 for ; Fri, 07 Mar 2014 11:10:41 -0800 (PST) X-Received: by 10.66.65.204 with SMTP id z12mr23864982pas.60.1394219441799; Fri, 07 Mar 2014 11:10:41 -0800 (PST) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id js7sm40276512pbc.35.2014.03.07.11.10.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 11:10:40 -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] module: LLVMLinux: Remove unused function warning from __param_check macro Date: Fri, 7 Mar 2014 11:08:47 -0800 Message-Id: <1394219327-5591-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 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::22d 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 declaration 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index c3eb102..5ce1f67 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -346,6 +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) __attribute__ ((unused)); \ static inline type *__check_##name(void) { return(p); } extern struct kernel_param_ops param_ops_byte;