From patchwork Tue Aug 13 06:27:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishka Dasgupta X-Patchwork-Id: 11091265 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 010BA746 for ; Tue, 13 Aug 2019 06:36:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7011284DA for ; Tue, 13 Aug 2019 06:36:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB0F9284E8; Tue, 13 Aug 2019 06:36:21 +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.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D0442284DC for ; Tue, 13 Aug 2019 06:36:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxQOr-0007av-Kb; Tue, 13 Aug 2019 06:35:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxQHF-0006o2-2y for xen-devel@lists.xenproject.org; Tue, 13 Aug 2019 06:27:25 +0000 X-Inumbo-ID: 697f1553-bd93-11e9-8980-bc764e045a96 Received: from mail-pg1-x541.google.com (unknown [2607:f8b0:4864:20::541]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 697f1553-bd93-11e9-8980-bc764e045a96; Tue, 13 Aug 2019 06:27:24 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id l21so50706803pgm.3 for ; Mon, 12 Aug 2019 23:27:24 -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=ibx8hLmGfI0HFnEN8rgDtTXlnoeKgOQ33MgGH/Cf62I=; b=IB3/UXaOwvdhrmNh27ty8Ii+onuD4FzDOyTyM8xWewA1ARXozSYH8FizkWFoHs3lz8 1xWID5z3zlfc/InMLKBHSiUDesIxfimN2XwfHgkxRHhUJGDz49gGZR/5zQDCLyZmH+PR Hvj5h0P0U6tOWgFaVydWgXurfgnd5o/hOrDAN19NwJDHcW9PDrBxlIMq2ijTBNo9MxO9 p/nl1M4CnO6LqHQYMtVjGH7p/51YYuhCiwiHreHj7NdgA8B0dvDbbWJz1FtsG936N1Ug Oaglbgo8IYsZSV+CkC7bnlXbf1VrX7XZ1Ufr+U+bAM0kvuBJ7/GeJD63JMjD2X+H/fg7 Bu+Q== 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=ibx8hLmGfI0HFnEN8rgDtTXlnoeKgOQ33MgGH/Cf62I=; b=HwUFGa1E6Lk/uEWUGZZg8KSfRKWud4X0Joswcfu1UFBJa7ssPfk/EkOwFm08RNqR37 tIREpjTYB9V/r1riXuXpt2WiiAuyw8x3LJkFn948m9Q1wV5UeJhvxm5efZ68MEbeyBwi ZiTSzt26ShFkanR96cvbe2TUf1+7mi2lhxTsPOzlWqxmQ+LQYUCFXa4kLi1a9177afK2 l4WTmVci9C/8XmRnW/5EJiEigTHU/KAkX0l5dKf9wLJ1Xfh7cSKw91yOdWm0OZgJzrrI wlddJ1MK4wCi3X0/rmVVgc8FnSIEORrdv1JRmdhj62l6lbI0Ui1+eg2JOArE3fF9/Bb3 159g== X-Gm-Message-State: APjAAAXo3HEUZTIYlrl88Ts96gzL6ZK8+gBu18Q9No+dg2IPJ3MeE1IC Iyh+ZG5UTRzy7vQ0nwHB4B8= X-Google-Smtp-Source: APXvYqxWKZdKuodrVWJAzbb9UMkztll3+RJHZbGwG7ibw+vZcY0oXPoxi0ofJEMVzTAm98Zer5Elmg== X-Received: by 2002:a63:b20f:: with SMTP id x15mr34234519pge.453.1565677643586; Mon, 12 Aug 2019 23:27:23 -0700 (PDT) Received: from localhost.localdomain ([122.163.110.75]) by smtp.gmail.com with ESMTPSA id f7sm104857165pfd.43.2019.08.12.23.27.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 23:27:23 -0700 (PDT) From: Nishka Dasgupta To: oleksandr_andrushchenko@epam.com, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, xen-devel@lists.xenproject.org Date: Tue, 13 Aug 2019 11:57:11 +0530 Message-Id: <20190813062712.24993-1-nishkadg.linux@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 13 Aug 2019 06:35:16 +0000 Subject: [Xen-devel] [PATCH] drm/xen-front: Make structure fb_funcs constant X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Nishka Dasgupta Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Static structure fb_funcs, of type drm_framebuffer_funcs, is used only when it is passed to drm_gem_fb_create_with_funcs() as its last argument. drm_gem_fb_create_with_funcs does not modify its lst argument (fb_funcs) and hence fb_funcs is never modified. Therefore make fb_funcs constant to protect it from further modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c index c2955d375394..4a984f45555e 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_kms.c +++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c @@ -45,7 +45,7 @@ static void fb_destroy(struct drm_framebuffer *fb) drm_gem_fb_destroy(fb); } -static struct drm_framebuffer_funcs fb_funcs = { +static const struct drm_framebuffer_funcs fb_funcs = { .destroy = fb_destroy, };