From patchwork Tue Mar 15 21:13:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 637331 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2FLDuqC016898 for ; Tue, 15 Mar 2011 21:13:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752243Ab1COVNz (ORCPT ); Tue, 15 Mar 2011 17:13:55 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:46305 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043Ab1COVNy (ORCPT ); Tue, 15 Mar 2011 17:13:54 -0400 Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p2FLDoIS011681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Mar 2011 21:13:51 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p2FLDnSM031784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Mar 2011 21:13:49 GMT Received: from abhmt014.oracle.com (abhmt014.oracle.com [141.146.116.23]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p2FLDnWk007927; Tue, 15 Mar 2011 16:13:49 -0500 Received: from chimera.site (/173.50.240.230) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 Mar 2011 14:13:49 -0700 Date: Tue, 15 Mar 2011 14:13:47 -0700 From: Randy Dunlap To: linux-kbuild@vger.kernel.org Cc: lkml , Michal Marek Subject: [PATCH] modpost: fix trailing comma Message-Id: <20110315141347.d4ee75d3.randy.dunlap@oracle.com> Organization: Oracle Linux Eng. X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; x86_64-unknown-linux-gnu) Mime-Version: 1.0 X-Source-IP: acsmt356.oracle.com [141.146.40.156] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4D7FD68E.00DF,ss=1,fgs=0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Mar 2011 21:13:56 +0000 (UTC) --- linux-next-20110315.orig/scripts/mod/modpost.c +++ linux-next-20110315/scripts/mod/modpost.c @@ -1248,6 +1248,19 @@ static int is_function(Elf_Sym *sym) return -1; } +static void print_section_list(const char * const list[20]) +{ + const char *const *s = list; + + while (*s) { + fprintf(stderr, "%s", *s); + s++; + if (*s) + fprintf(stderr, ", "); + } + fprintf(stderr, "\n"); +} + /* * Print a warning about a section mismatch. * Try to find symbols near it so user can find it. @@ -1304,7 +1317,6 @@ static void report_sec_mismatch(const ch break; case DATA_TO_ANY_INIT: { prl_to = sec2annotation(tosec); - const char *const *s = mismatch->symbol_white_list; fprintf(stderr, "The variable %s references\n" "the %s %s%s%s\n" @@ -1312,9 +1324,7 @@ static void report_sec_mismatch(const ch "variable with __init* or __refdata (see linux/init.h) " "or name the variable:\n", fromsym, to, prl_to, tosym, to_p); - while (*s) - fprintf(stderr, "%s, ", *s++); - fprintf(stderr, "\n"); + print_section_list(mismatch->symbol_white_list); free(prl_to); break; } @@ -1329,7 +1339,6 @@ static void report_sec_mismatch(const ch break; case DATA_TO_ANY_EXIT: { prl_to = sec2annotation(tosec); - const char *const *s = mismatch->symbol_white_list; fprintf(stderr, "The variable %s references\n" "the %s %s%s%s\n" @@ -1337,9 +1346,7 @@ static void report_sec_mismatch(const ch "variable with __exit* (see linux/init.h) or " "name the variable:\n", fromsym, to, prl_to, tosym, to_p); - while (*s) - fprintf(stderr, "%s, ", *s++); - fprintf(stderr, "\n"); + print_section_list(mismatch->symbol_white_list); free(prl_to); break; }