From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Witold Szczeponik" Subject: [PATCH, trivial] PNP: Use constant PNP_ID_LEN instead of literal number Date: Sun, 27 Nov 2011 22:26:20 +0100 Message-ID: <20111127212620.268500@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mailout-de.gmx.net ([213.165.64.23]:44006 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753397Ab1K0V0Z (ORCPT ); Sun, 27 Nov 2011 16:26:25 -0500 Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org The attached patch uses the constant PNP_ID_LEN instead of using a=20 literal number for the length of a PNP ID in the scope of PNP quirks. As a consequence, all IDs used in PNP quirks (c.f. "drivers/pnp/quirks.= c")=20 are now zero-terminated and standard functions that depend on the IDs=20 to be zero-terminated now work reliably (c.f. "strlen" in "drivers/pnp/= driver.c",=20 function "compare_pnp_id").=20 The patch is applied against 3.1.=20 Signed-off-by: Witold Szczeponik Index: linux/include/linux/pnp.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux.orig/include/linux/pnp.h +++ linux/include/linux/pnp.h @@ -295,7 +295,7 @@ static inline void pnp_set_drvdata(struc } =20 struct pnp_fixup { - char id[7]; + char id[PNP_ID_LEN]; void (*quirk_function) (struct pnp_dev * dev); /* fixup function */ }; =20 --=20 NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur=C3=BCck-Garantie! = =09 Jetzt informieren: http://www.gmx.net/de/go/freephone -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755755Ab1K0V01 (ORCPT ); Sun, 27 Nov 2011 16:26:27 -0500 Received: from mailout-de.gmx.net ([213.165.64.23]:44007 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755414Ab1K0V0Z (ORCPT ); Sun, 27 Nov 2011 16:26:25 -0500 Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Date: Sun, 27 Nov 2011 22:26:20 +0100 From: "Witold Szczeponik" Message-ID: <20111127212620.268500@gmx.net> MIME-Version: 1.0 Subject: [PATCH, trivial] PNP: Use constant PNP_ID_LEN instead of literal number To: linux-acpi@vger.kernel.org X-Authenticated: #787645 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18R6aRHwNgRFdOtvxcdEoNZTwGWi1PT7qZpE5PlP/ ci9r9t035b5thFrh/dCiGV1415Wi6sr3IShA== Content-Transfer-Encoding: 8bit X-GMX-UID: y5LneqkiRkkNSsl+f2Rq+cpudWkvKJOo Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The attached patch uses the constant PNP_ID_LEN instead of using a literal number for the length of a PNP ID in the scope of PNP quirks. As a consequence, all IDs used in PNP quirks (c.f. "drivers/pnp/quirks.c") are now zero-terminated and standard functions that depend on the IDs to be zero-terminated now work reliably (c.f. "strlen" in "drivers/pnp/driver.c", function "compare_pnp_id"). The patch is applied against 3.1. Signed-off-by: Witold Szczeponik Index: linux/include/linux/pnp.h =================================================================== --- linux.orig/include/linux/pnp.h +++ linux/include/linux/pnp.h @@ -295,7 +295,7 @@ static inline void pnp_set_drvdata(struc } struct pnp_fixup { - char id[7]; + char id[PNP_ID_LEN]; void (*quirk_function) (struct pnp_dev * dev); /* fixup function */ }; -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone