Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751203AbbESAHm (ORCPT ); Mon, 18 May 2015 20:07:42 -0400 Received: from smtprelay0172.hostedemail.com ([216.40.44.172]:33697 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750846AbbESAHj (ORCPT ); Mon, 18 May 2015 20:07:39 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 13,1.2,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:69:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4605:5007:6119:6261:7576:7903:7974:7996:8603:9545:10008:10400:10848:10967:11026:11473:11658:11914:12043:12262:12296:12438:12517:12519:12555:12679:12683:12740:13069:13161:13229:13311:13357:14110:21063:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:1:0 X-HE-Tag: spy38_843608f74d2f X-Filterd-Recvd-Size: 2532 Message-ID: <1431994055.2870.102.camel@perches.com> Subject: mod_devicetable: Make dmi_strmatch.substr const char * From: Joe Perches To: David Woodhouse , Rusty Russell Cc: LKML , Quentin Casasnovas Date: Mon, 18 May 2015 17:07:35 -0700 Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1985 Lines: 59 Hey David, Rusty, Quentin This commit: ------------------------------ commit d945b697d0eea5a811ec299c5f1a25889bb0242b From: David Woodhouse Date: Tue, 16 Sep 2008 16:23:28 -0700 Subject: [PATCH] Automatic MODULE_ALIAS() for DMI match tables. This makes modpost handle MODULE_DEVICE_TABLE(dmi, xxxx). I had to change the string pointers in the match table to char arrays, and picked a size of 79 bytes almost at random -- do we need to make it bigger than that? I was a bit concerned about the 'bloat' this introduces into the match tables, but they should all be __initdata so it shouldn't matter too much. (Actually, modpost does go through the relocations and look at most of them; it wouldn't be impossible to make it handle string pointers -- but doesn't seem to be worth the effort, since they're __initdata). ------------------------------ changed dmi_strmatch.substr from char * to char[79]; Changing it back to const char * would shrink an x86-64 defconfig more than 100KB. $ size vmlinux.old vmlinux.new text data bss dec hex filename 11941725 1825624 1085440 14852789 e2a2b5 vmlinux.old 11921172 1730648 1085440 14737260 e0df6c vmlinux.new modpost has changed a bit since 2008, is it's time to change it back? --- include/linux/mod_devicetable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 7ab00d6..66c4309 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -462,7 +462,7 @@ enum dmi_field { struct dmi_strmatch { unsigned char slot:7; unsigned char exact_match:1; - char substr[79]; + const char *substr; }; struct dmi_system_id { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/