From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405AbdKLVTs (ORCPT ); Sun, 12 Nov 2017 16:19:48 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:56414 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbdKLVTm (ORCPT ); Sun, 12 Nov 2017 16:19:42 -0500 X-Google-Smtp-Source: AGs4zMZYSQXIjwz7/O2QQDCJj/R79T7Xd1VW7hm3D6yTjWCzvDnXBEzi/5DIGY9Quxey7KyRXo1fpA== From: Rasmus Villemoes To: Kees Cook , Jean Delvare Cc: Rasmus Villemoes , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] hwmon: (applesmc) Apply format_template attribute Date: Sun, 12 Nov 2017 22:19:08 +0100 Message-Id: <20171112211911.27779-2-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171112211911.27779-1-linux@rasmusvillemoes.dk> References: <20171112211911.27779-1-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This serves as human-readable documentation as well as allowing the format_template plugin to complain about any static initializers of this struct member that do not have the same set of printf specifiers. Signed-off-by: Rasmus Villemoes --- drivers/hwmon/applesmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 5c677ba44014..9e6d23cba23e 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -110,7 +110,7 @@ struct applesmc_dev_attr { /* Dynamic device node group */ struct applesmc_node_group { - char *format; /* format string */ + char *format __format_template("%d"); /* format string */ void *show; /* show function */ void *store; /* store function */ int option; /* function argument */ -- 2.11.0