Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4573241ybv; Mon, 17 Feb 2020 01:40:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzd1NODOf/agmySoRXWXe0JLYzBI6oBBcD7hp85etlO2gmSc55TjXLqWL/zqQpx0r4C4MSs X-Received: by 2002:a05:6830:184:: with SMTP id q4mr11628348ota.232.1581932459123; Mon, 17 Feb 2020 01:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581932459; cv=none; d=google.com; s=arc-20160816; b=rV55ggnaFkqSxFy3nMq9xBsutRPqs3B79Pmy/ZSXS9k0i3IAsxw+S3XgUHoxfIoG9P 8P3cQMCWRTWFIOxJGxnxU8uv2WCY9jXEFZZZI+I08pd3nGFkD8ldyP7MwbeVUIwR7IbV 0Wu5a9ufrJDOwmucJLfvS2oqreMn5kTtJcMy0QNGCs9AcvVaewm7dozBSPL/YX4hQwY8 3+1r2SX9SA5W657jgZlHWS+q2wGvezBvGjgkwNm6qm6ImePZZFUVmcIVkHmUePCQcaoE be0KfdTSNYBEiNC7ouQaL06RUW6uHizhrq/5YjbQ/opuuJtmWtOaTrNcyUH9EToTA9sJ fPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PUaDCVtEtzXcVm/3QWXjn1VI0HgM3qynYYuCL9fHC4g=; b=pToH3alKYKRV9F0IZP6ZKBxIDlJ751ITWxtQr2KiWSCDn00Az+JNIC/TyCKdqcqUZC A/4Rh5aMv01xNClKWYhcMRKc3upml47cDa7eOYUUDSJ4C76z0HcXSLeeLKvkP8VeO0r/ rrwUTKbywdfuci7xPhzrGa2cTo6UL28KIzpZo9XYE8Ayvs8FE6wVYcVko+0TJgHRSK5D dspLvh1w0WKBGFPGSbCJ81zPg4nLYE3gXjga3BNa3rClXoXL//6QEitS9LjlgBeCit1B LI+wnmJUGo8pCJ1DGtii6P4OxY+4KtBeGLnHcTF7dDWXaixViqwZ7U3kooUUXgJqa14J YS3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SVkGBK7b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18si6884179otf.231.2020.02.17.01.40.47; Mon, 17 Feb 2020 01:40:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SVkGBK7b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728993AbgBQJkk (ORCPT + 99 others); Mon, 17 Feb 2020 04:40:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:40512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbgBQJkj (ORCPT ); Mon, 17 Feb 2020 04:40:39 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 96F742070B; Mon, 17 Feb 2020 09:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581932439; bh=fksEsw2TEJe3oWeqVvBmZb9SfqjxPG70zCcZxBZL/mc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SVkGBK7bQk9qU8H1FYIAn2BmVTJNjUnYYLY3ulODrRl30OKVNL5RxzZjstyEFcwrM t5f07SSslsDClvAsEY/plVTMx6Sm1LzPCeEnKhu+op3yYDyr249Y2Ejy+AlPgvLvV9 UQY5goxPYdqOEnpnP5/2jSsU15GHFsjkx7QkD6gA= Date: Mon, 17 Feb 2020 10:40:36 +0100 From: Greg Kroah-Hartman To: Joe Perches Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel Subject: Re: [PATCH] usb-storage: Use const to reduce object data size Message-ID: <20200217094036.GA47231@kroah.com> References: <60559197a1af9e0af7f329cc3427989e5756846f.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <60559197a1af9e0af7f329cc3427989e5756846f.camel@perches.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 14, 2020 at 10:15:57AM -0800, Joe Perches wrote: > Make structs const to reduce data size ~20KB. > > Change function arguments and prototypes as necessary to compile. > > $ size (x86-64 defconfig pre) > text data bss dec hex filename > 12281 10948 480 23709 5c9d ./drivers/usb/storage/usb.o > 111 10528 8 10647 2997 ./drivers/usb/storage/usual-tables.o > > $ size (x86-64 defconfig post) > text data bss dec hex filename > 22809 420 480 23709 5c9d drivers/usb/storage/usb.o > 10551 0 0 10551 2937 drivers/usb/storage/usual-tables.o > > Signed-off-by: Joe Perches > --- > > compile tested only > > drivers/usb/storage/usb.c | 10 +++++----- > drivers/usb/storage/usb.h | 5 +++-- > drivers/usb/storage/usual-tables.c | 6 +++--- > include/linux/usb_usual.h | 2 +- > 4 files changed, 12 insertions(+), 11 deletions(-) > > diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c > index 9a79cd..94a6472 100644 > --- a/drivers/usb/storage/usb.c > +++ b/drivers/usb/storage/usb.c > @@ -121,12 +121,12 @@ MODULE_PARM_DESC(quirks, "supplemental list of > device IDs and their quirks"); > .initFunction = init_function, \ > } > > -static struct us_unusual_dev us_unusual_dev_list[] = { > +static const struct us_unusual_dev us_unusual_dev_list[] = { > # include "unusual_devs.h" > { } /* Terminating entry */ > }; > > -static struct us_unusual_dev for_dynamic_ids = > +static const struct us_unusual_dev for_dynamic_ids = > USUAL_DEV(USB_SC_SCSI, USB_PR_BULK); > > #undef UNUSUAL_DEV > @@ -583,7 +583,7 @@ EXPORT_SYMBOL_GPL(usb_stor_adjust_quirks); > > /* Get the unusual_devs entries and the string descriptors */ > static int get_device_info(struct us_data *us, const struct > usb_device_id *id, Patch is line-wrapped and does not apply at all :(