summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-fsl-usb.c
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-08-19 09:42:34 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2019-08-28 12:04:59 +0200
commitf1b19006f4c9e83c9e19c58102157ff1fdebca22 (patch)
tree2511c9093de45a5dde22c3a12f9ae0e9f1ccd609 /drivers/usb/phy/phy-fsl-usb.c
parentusb: udc: lpc32xx: silence fall-through warning (diff)
downloadlinux-f1b19006f4c9e83c9e19c58102157ff1fdebca22.tar.xz
linux-f1b19006f4c9e83c9e19c58102157ff1fdebca22.zip
usb: phy: phy-fsl-usb: Make structure fsl_otg_initdata constant
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 <nishkadg.linux@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/phy/phy-fsl-usb.c')
-rw-r--r--drivers/usb/phy/phy-fsl-usb.c2
1 files changed, 1 insertions, 1 deletions
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,
};