From nobody Fri Nov 22 17:08:52 2024 Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BB8D18DF64 for ; Fri, 15 Nov 2024 21:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.29 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731705890; cv=none; b=N5xOa48o8wJH7I2ISCP9wWhsbP97br5T4XTIo72hOhU8SwmacToSCS6BnJtoazh8PdHCBDq+dfCCIHcMFz7jq9SdG0QfYZ3Jyqf2cKjQuCGVgfBrND70kVE6/WgyFALC4HMKXNwX3pWhbTfBsPtKziI5svO9FTxpUQCu5/CXtYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731705890; c=relaxed/simple; bh=Bgs/12PtZuTnrvMeWK5ZWfYat10JaNSvHluJaDBzt2Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d35UyThVCgr+OyFsZPJ6r6s0ZKLTsV1blmTkzTqcS4G8k8eYet/zAaDGY5S/VEIeb72LrG1/3K55D9pARDJJP522EHdZfaZXMb0k2YGzZYvl5yOZ0IX+jjt00rv3Rra4YrWj/LjxfsC9V5WJi0wKac+bTg0EyAqkUtVZ9VGb9fM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=sXW1ZkB2; arc=none smtp.client-ip=80.12.242.29 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="sXW1ZkB2" Received: from localhost.localdomain ([90.11.132.44]) by smtp.orange.fr with ESMTPA id C3mwtFV0AeGuUC3mxtsoiA; Fri, 15 Nov 2024 22:23:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1731705815; bh=Hs/wZDfKXx3ShBLaY4pSoUha6GqQ4qK+FdcROdbUR3o=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=sXW1ZkB2a1904wsfA+dXdNNvVC5/+Q3NlyOKX6RxWyt7VipMhR20sWwrck/u81oBX 8EPnl28rnZPHvmUOPT0fRY9+VTeMLvj4TXP1hEn9YyvHXnKSoHjTUveXNiKZcfWU1u OLxIHAaNhqjmyKjtOEbwa4j849DWDuwqlEduxJIkfpSAaPZGxtW2mWQ+wqipEmgz4B gzuzJvpndLaVjVvYBc1tw7H+nehgfjhqriwLVnAU90GgU+N3lPeJWJBpRnhWRfeWQ2 IJwwVDaSVRfNMWjE1OeFN5AfVaCx6PKeeXDTV1tq5on/V5soxFuy2ILeVHSePdBgYY zVat3qTHOayYg== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 15 Nov 2024 22:23:35 +0100 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: Sudip Mukherjee Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] parport: parport_serial: Constify some structures Date: Fri, 15 Nov 2024 22:23:21 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'struct parport_pc_pci, 'struct pci_device_id' and 'struct pciserial_board' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: =3D=3D=3D=3D=3D=3D text data bss dec hex filename 8125 5232 0 13357 342d drivers/parport/parport_serial.o After: =3D=3D=3D=3D=3D text data bss dec hex filename 12272 1072 0 13344 3420 drivers/parport/parport_serial.o Signed-off-by: Christophe JAILLET --- Compile tested-only. --- drivers/parport/parport_serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_ser= ial.c index 3644997a8342..9ffbd69a32d9 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c @@ -118,7 +118,7 @@ static int netmos_parallel_init(struct pci_dev *dev, st= ruct parport_pc_pci *par, return 0; } =20 -static struct parport_pc_pci cards[] =3D { +static const struct parport_pc_pci cards[] =3D { /* titan_110l */ { 1, { { 3, -1 }, } }, /* titan_210l */ { 1, { { 3, -1 }, } }, /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init }, @@ -168,7 +168,7 @@ static struct parport_pc_pci cards[] =3D { /* brainboxes_px263 */ { 1, { { 3, -1 }, } }, }; =20 -static struct pci_device_id parport_serial_pci_tbl[] =3D { +static const struct pci_device_id parport_serial_pci_tbl[] =3D { /* PCI cards */ { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_110L, PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_110l }, @@ -328,7 +328,7 @@ MODULE_DEVICE_TABLE(pci,parport_serial_pci_tbl); * Cards not tested are marked n/t * If you have one of these cards and it works for you, please tell me.. */ -static struct pciserial_board pci_parport_serial_boards[] =3D { +static const struct pciserial_board pci_parport_serial_boards[] =3D { [titan_110l] =3D { .flags =3D FL_BASE1 | FL_BASE_BARS, .num_ports =3D 1, @@ -619,7 +619,7 @@ struct parport_serial_private { static int serial_register(struct pci_dev *dev, const struct pci_device_id= *id) { struct parport_serial_private *priv =3D pci_get_drvdata (dev); - struct pciserial_board *board; + const struct pciserial_board *board; struct serial_private *serial; =20 board =3D &pci_parport_serial_boards[id->driver_data]; --=20 2.47.0