From patchwork Thu Apr 19 04:39:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 10349111 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F7F760244 for ; Thu, 19 Apr 2018 04:40:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6216F28929 for ; Thu, 19 Apr 2018 04:40:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55E2528978; Thu, 19 Apr 2018 04:40:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD6A728929 for ; Thu, 19 Apr 2018 04:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695AbeDSEku (ORCPT ); Thu, 19 Apr 2018 00:40:50 -0400 Received: from gate.crashing.org ([63.228.1.57]:51661 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbeDSEku (ORCPT ); Thu, 19 Apr 2018 00:40:50 -0400 Received: from pasglop.au.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w3J4e6KO018170; Wed, 18 Apr 2018 23:40:08 -0500 From: Benjamin Herrenschmidt To: linux-usb@vger.kernel.org Cc: Felipe Balbi , Greg KH , Joel Stanley , Andrew Jeffery , Benjamin Herrenschmidt Subject: [RESEND v8 1/2] usb/gadget: Constify usb_gadget_get_string "table" argument Date: Thu, 19 Apr 2018 14:39:59 +1000 Message-Id: <20180419044000.7860-1-benh@kernel.crashing.org> X-Mailer: git-send-email 2.14.3 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The table is never modified by the function. This allows us to use it on a statically defined table that is marked const. Signed-off-by: Benjamin Herrenschmidt --- drivers/usb/gadget/usbstring.c | 2 +- include/linux/usb/gadget.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c index 566ab261e8b7..7c24d1ce1088 100644 --- a/drivers/usb/gadget/usbstring.c +++ b/drivers/usb/gadget/usbstring.c @@ -33,7 +33,7 @@ * characters (which are also widely used in C strings). */ int -usb_gadget_get_string (struct usb_gadget_strings *table, int id, u8 *buf) +usb_gadget_get_string (const struct usb_gadget_strings *table, int id, u8 *buf) { struct usb_string *s; int len; diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index e3424234b23a..64e7c159d534 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -763,7 +763,7 @@ struct usb_gadget_string_container { }; /* put descriptor for string with that id into buf (buflen >= 256) */ -int usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf); +int usb_gadget_get_string(const struct usb_gadget_strings *table, int id, u8 *buf); /*-------------------------------------------------------------------------*/