From patchwork Mon Aug 19 07:55:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishka Dasgupta X-Patchwork-Id: 11100437 X-Patchwork-Delegate: agross@codeaurora.org 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 5507713A0 for ; Mon, 19 Aug 2019 07:56:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 477BD27D0C for ; Mon, 19 Aug 2019 07:56:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A52F2858B; Mon, 19 Aug 2019 07:56:11 +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 D867E27D0C for ; Mon, 19 Aug 2019 07:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725958AbfHSH4K (ORCPT ); Mon, 19 Aug 2019 03:56:10 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45348 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbfHSH4K (ORCPT ); Mon, 19 Aug 2019 03:56:10 -0400 Received: by mail-pg1-f196.google.com with SMTP id o13so719522pgp.12; Mon, 19 Aug 2019 00:56:09 -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=CfD4pxcmsBOD0JzPOjdXmaU+TeQQm+86Lzg/ymH88+k=; b=BArwRWm1ImVBI8S4DBJT/VvuVmBZnlj9RnPnF5Wi9GHZ0l3LeIfYbKTGMKYe2uEeG9 +o+4yfpSLOqP2BulTYzUtrt8ydxadNV+EUkxe3sif6Mnq6c/KThkgyrGo9alPuVw1P5W amiZeXP9PY5q+sFaqz9wZF92NtZU2b4oQgTgc2XobhDrh3LROIo6zFvO+obysEWKMEPZ 0JyrT6chmjuCwlIt+Q+Kv5wp0UbJKcEMAQhPdIGx4L1Bqrf6JHxzw3q7T5cPh0COpI2I MOJO8rsrhzzcbt3cYU7hFh3VC2osh5A0wKN0R67QGFF7YkU8FaKZOZPL/8zJsTWK/Wbc 7dkw== 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=CfD4pxcmsBOD0JzPOjdXmaU+TeQQm+86Lzg/ymH88+k=; b=GJcUcrSwQaTSrl6F/XuXocYkvnF1WVjdCcAYop0LP6HLd+JsWvZgmStlmpTmaNnvli MQSISyI7EUZhFUK3M4NAzm37vTlf4ShFHt0RdK01c9FBBpwtySyb0Jwu73cEtXmhhUe9 T1iqxji2JvDvo/oEmfmYkl8OP0q+9Vv/CIpHOQUQin8I2z3Yv+vN0jIU+gf8rrjuKr+I 8s1V2pBLdRA0OGnnN6n9hSnQDm8DkhMEH8pnzpAR2JDVT6sxvQAdVnC89k+R4Tzuhf6+ UOLRRIFw0Vz1zf0VodfNL5VkLg9ymGw4KcO5Hxp5XBVGiAsI3TIrk8LeoOCr7S+4t4bG M51w== X-Gm-Message-State: APjAAAUCetI5/OBv5sH1ElZG3jdAy5Yi9z7BqK2KxiYKtS1iJnGFCu9C znKpLEqWIlAZjuvppxsaeSk= X-Google-Smtp-Source: APXvYqwrzXMMw4vjlEp/kre9mkNnD1+WQhWHfjp7nEGi7/gdILYk21UrhrkUeenIx3QOJXF6ASVjRQ== X-Received: by 2002:a63:fa11:: with SMTP id y17mr18873142pgh.267.1566201369424; Mon, 19 Aug 2019 00:56:09 -0700 (PDT) Received: from localhost.localdomain ([110.225.16.165]) by smtp.gmail.com with ESMTPSA id e13sm19148162pfl.130.2019.08.19.00.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 00:56:09 -0700 (PDT) From: Nishka Dasgupta To: agross@kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, pedrom.sousa@synopsys.com, jejb@linux.ibm.com, martin.peterson@oracle.com, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Nishka Dasgupta Subject: [PATCH] scsi: ufs-qcom: Make structure ufs_hba_qcom_vops constant Date: Mon, 19 Aug 2019 13:25:57 +0530 Message-Id: <20190819075557.1547-1-nishkadg.linux@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Static structure ufs_hba_qcom_vops, of type ufs_hba_variant_ops, is used only once, when it is passed as the second argument to function ufshcd_pltfrm_init(). In the definition of ufshcd_pltfrm_init(), its second parameter (corresponding to ufs_hba_qcom_vops) is declared as constant. Hence declare ufs_hba_qcom_vops itself constant as well to protect it from unintended modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta Reviewed-by: Vivek Gautam --- drivers/scsi/ufs/ufs-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index ee4b1da1e223..4473f339cbc0 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1551,7 +1551,7 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba) * The variant operations configure the necessary controller and PHY * handshake during initialization. */ -static struct ufs_hba_variant_ops ufs_hba_qcom_vops = { +static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = { .name = "qcom", .init = ufs_qcom_init, .exit = ufs_qcom_exit,