Return-Path: Received: from mail-by2nam03on0122.outbound.protection.outlook.com ([104.47.42.122]:29390 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032086AbeCAP2M (ORCPT ); Thu, 1 Mar 2018 10:28:12 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Michal Marek , Sasha Levin Subject: [added to the 4.1 stable tree] genksyms: Handle string literals with spaces in reference files Date: Thu, 1 Mar 2018 15:23:42 +0000 Message-ID: <20180301152116.1486-117-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Michal Marek This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit a78f70e8d65e88b9f631d073f68cb26dcd746298 ] The reference files use spaces to separate tokens, however, we must preserve spaces inside string literals. Currently the only case in the tree is struct edac_raw_error_desc in : $ KBUILD_SYMTYPES=3D1 make -s drivers/edac/amd64_edac.symtypes $ mv drivers/edac/amd64_edac.{symtypes,symref} $ KBUILD_SYMTYPES=3D1 make -s drivers/edac/amd64_edac.symtypes drivers/edac/amd64_edac.c:527: warning: amd64_get_dram_hole_info: modversio= n changed because of changes in struct edac_raw_error_desc Signed-off-by: Michal Marek Signed-off-by: Sasha Levin --- scripts/genksyms/genksyms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c index 88632df4381b..dafaf96e0a34 100644 --- a/scripts/genksyms/genksyms.c +++ b/scripts/genksyms/genksyms.c @@ -423,13 +423,15 @@ static struct string_list *read_node(FILE *f) struct string_list node =3D { .string =3D buffer, .tag =3D SYM_NORMAL }; - int c; + int c, in_string =3D 0; =20 while ((c =3D fgetc(f)) !=3D EOF) { - if (c =3D=3D ' ') { + if (!in_string && c =3D=3D ' ') { if (node.string =3D=3D buffer) continue; break; + } else if (c =3D=3D '"') { + in_string =3D !in_string; } else if (c =3D=3D '\n') { if (node.string =3D=3D buffer) return NULL; --=20 2.14.1