From patchwork Mon Aug 19 07:42:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishka Dasgupta X-Patchwork-Id: 11100423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B29B112C for ; Mon, 19 Aug 2019 07:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F20FE28562 for ; Mon, 19 Aug 2019 07:42:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E49F02859E; Mon, 19 Aug 2019 07:42:46 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 90CB228562 for ; Mon, 19 Aug 2019 07:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbfHSHmq (ORCPT ); Mon, 19 Aug 2019 03:42:46 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46681 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbfHSHmp (ORCPT ); Mon, 19 Aug 2019 03:42:45 -0400 Received: by mail-pf1-f196.google.com with SMTP id q139so666669pfc.13 for ; Mon, 19 Aug 2019 00:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ynq4+VSfItLDw42HSG2PmPwxQIaEP9/TG6Qe0lfaHR4=; b=M1DTO8zGg3YK4giGrLPe/Y27h33Sx5VM4k5s7fYPW+GrHZ+1jFaloTYQhNrxILDs1B qUwtZBAAAoGCqXxAGLotu1jQ9L3KpGY+zJI3ygV5SR5FvN3a1Y4AtDt5a3SWjrqoAkiU ieLPLPIY01P/4CCRHaofl7Lmjor6gCIHVNTJ/rkbv0FNeYI1izTzRHTDveVL2rhWVVpN eOmBSg+Pozci57sIPhYALWk95HruObvNgeSyceNBjETTMn1Ch3LYWsmYoaF+gvBWrVF0 16DIGrD4OhWhNKWJNJ3VbKN6UGX+S1gRbtNhLAAHGlzB7f9wQZHUYJpqkbTz2Djt6wxF ZO0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ynq4+VSfItLDw42HSG2PmPwxQIaEP9/TG6Qe0lfaHR4=; b=PFWw6hZQWmwu1Yw4xD4/V1Ybe0FfYm/TsBnLzv/0ZoEZepm0pw2K/lg99VGJz/G7Y+ OpxFb6S54/Wah6cPAlns4j0LrWUt273j3TnaPfafvJD1jJCRu98237yWv/S3sEjSISvC xNfT2u4opmJveaY9Gl+yWkppN+Lh5CgZ/21XoBHsNvdwJL1XWgXePV4F5GxnANMkUMvJ xlrpUSpwI+VIkF1pdMwZQhbhO6f1sF937p/w95U3Y3qdGFQz38wnBsbFhRURMSak2osv 6KNw6NmMwBS9c0sAEJgLEvFfaGhw8h15Edz1zkrX229XrO+/g4OZMh7JKlSe7FXgUoVT bfSA== X-Gm-Message-State: APjAAAUA6U1CY6q2m7J3wZ0ebdCM6cAdkjI+XMCUZ76W5lo0qAY+OFXH 68bEaIRfKFel5YJ/mFY2Jw8= X-Google-Smtp-Source: APXvYqzApaBTGrNLLBAzBwAQZHdm5R5RJJGMImGlHGBrDEwPAg/LNkku4yHh9YgjlegVCPgff9ablQ== X-Received: by 2002:a17:90a:36ad:: with SMTP id t42mr19109655pjb.21.1566200565353; Mon, 19 Aug 2019 00:42:45 -0700 (PDT) Received: from localhost.localdomain ([110.225.16.165]) by smtp.gmail.com with ESMTPSA id p10sm7341297pjr.14.2019.08.19.00.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 00:42:44 -0700 (PDT) From: Nishka Dasgupta To: balbi@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org Cc: Nishka Dasgupta Subject: [PATCH] usb: phy: phy-fsl-usb: Make structure fsl_otg_initdata constant Date: Mon, 19 Aug 2019 13:12:34 +0530 Message-Id: <20190819074234.32625-1-nishkadg.linux@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 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 Static structure fsl_otg_initdata, of type fsl_otg_config, is used only once, when the value of its field otg_port is assigned to another variable. As fsl_otg_initdata.otg_port is of type u8, any changes to its copy do not affect the original, and fsl_otg_initdata itself is never modified. Hence make fsl_otg_initdata constant to protect it from unintended modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/usb/phy/phy-fsl-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index f7c96d209eda..dbb2d4d54894 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -65,7 +65,7 @@ struct fsl_otg_timer *b_data_pulse_tmr, *b_vbus_pulse_tmr, *b_srp_fail_tmr, static struct list_head active_timers; -static struct fsl_otg_config fsl_otg_initdata = { +static const struct fsl_otg_config fsl_otg_initdata = { .otg_port = 1, };