From patchwork Tue Aug 13 06:25:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishka Dasgupta X-Patchwork-Id: 11095251 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 346EE1399 for ; Thu, 15 Aug 2019 08:36:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24E272876B for ; Thu, 15 Aug 2019 08:36:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18B962884A; Thu, 15 Aug 2019 08:36:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D71862876B for ; Thu, 15 Aug 2019 08:36:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F035E6E8F3; Thu, 15 Aug 2019 08:35:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 68AEC6E059 for ; Tue, 13 Aug 2019 06:26:02 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id t14so48824700plr.11 for ; Mon, 12 Aug 2019 23:26:02 -0700 (PDT) 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=InbrtY8dAbwb/AvFuK0cFDB3sfg6Iw3ZgPfhmVbir4Y=; b=DsKr1y9mqLXAlh5P439vsE3f2OUs2xVAQGMNT0e29QRi1nu4PesFKBRafF83fXsfZv quPqX1AJ+8h6oco7EdK8o4JbpynzLmMRKRJUit+WFpDLWCaUIpmCneKioRHX9CoA6pob //KKeIyIPATPwHQRWlmTHbYPoFHQarMJW1JyKakwEG9HdALItG3Olq1+A6yMG0DVV0RT k58IxcjWiTCMeiwelHFC1toGAZLhH8CFHK+dSoOa17uVLdXu942vTWeI9phD2+iLwTPn comI1Un8NZ97OuDiT7yxtqU768+AiKHPJclIPEbZg29sfaZun7op79Yaa4VsZiU7Nu/Y xL0Q== X-Gm-Message-State: APjAAAWYNPAKN1QQVO/4XLT1vaRJhGjEhr4tH+u7KrxQlWZjFdooUVG1 7wNAJVLFTLJYvKhNnsBbFnM= X-Google-Smtp-Source: APXvYqz6FjP5yU1Un3HZXDZEwPSzwYT5yGzyK40BuGaSWI8I8Q6l1JtU9sHZBEUfQw6gnswY++9uFg== X-Received: by 2002:a17:902:74c4:: with SMTP id f4mr34807883plt.13.1565677562055; Mon, 12 Aug 2019 23:26:02 -0700 (PDT) Received: from localhost.localdomain ([122.163.110.75]) by smtp.gmail.com with ESMTPSA id m4sm184279289pff.108.2019.08.12.23.25.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 23:26:01 -0700 (PDT) From: Nishka Dasgupta To: hdegoede@redhat.com, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vboxvideo: Make structure vbox_fb_helper_funcs constant Date: Tue, 13 Aug 2019 11:55:48 +0530 Message-Id: <20190813062548.24770-1-nishkadg.linux@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-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=InbrtY8dAbwb/AvFuK0cFDB3sfg6Iw3ZgPfhmVbir4Y=; b=QCtPmNLGRtJWnaKbVF7JxCXVTCbVqEL2Z67r0MjvXyqhZa084nliVV4TiXgRBv8Qm0 mCinWkSGMfGr08Ae+2cvO3JPZmbgvIIZ4QudKdRd0v1OPFiEHcF/o3dk18cT0moFBCiy zFYAKhe1ZybhxWrE7dzNXXbUJlD9sOVPiYfP7qp420T4lqxC9IVwZ06hiW2RJuwl5od7 nwEl8LeaBSm2q+c5Bsqyh3BpylF7cM3BSvfZYbz2sbOmGTOpLAApIf5a6tYtGMvC10Gx dSvPrD/G40nc05wMqtkJ2ok6Of6DY/eoIVhWPnutyyLm6XVfKA7nNL0UYddHzIk/9BEN pagQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishka Dasgupta Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The static structure vbox_fb_helper_funcs, of type drm_fb_helper_funcs, is used only when it is passed as the third argument to drm_fb_helper_fbdev_setup(), which does not modify it. Hence make it constant to protect it from unintended modifications. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c b/drivers/gpu/drm/vboxvideo/vbox_drv.c index 02537ab9cc08..2b57ea3195f2 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_drv.c +++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c @@ -32,7 +32,7 @@ static const struct pci_device_id pciidlist[] = { }; MODULE_DEVICE_TABLE(pci, pciidlist); -static struct drm_fb_helper_funcs vbox_fb_helper_funcs = { +static const struct drm_fb_helper_funcs vbox_fb_helper_funcs = { .fb_probe = vboxfb_create, };