From patchwork Sun Oct 28 06:07:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 10658471 X-Patchwork-Delegate: andy.shevchenko@gmail.com 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 B4CCC14DE for ; Sun, 28 Oct 2018 06:07:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 976B52915E for ; Sun, 28 Oct 2018 06:07:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84AB429F6F; Sun, 28 Oct 2018 06:07:10 +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 1B8432915E for ; Sun, 28 Oct 2018 06:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbeJ1Oup (ORCPT ); Sun, 28 Oct 2018 10:50:45 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42337 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbeJ1Oup (ORCPT ); Sun, 28 Oct 2018 10:50:45 -0400 Received: by mail-pf1-f196.google.com with SMTP id f26-v6so2440205pfn.9; Sat, 27 Oct 2018 23:07:08 -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; bh=GsAq7xNf+bkdex0pSug1EkyY6fyBIT+YzZtQzWaglxI=; b=irejrCucbotLNOhehMN7qEI8tE8f6HKqHMYpCaQBN2WB+8BO5gMbv+/7N8gU5WaBpl vlGF8+6yB+9XQoTI47bwp4M+552I7/LaL/+ZH0viDogVSCb72eeLMpxuoAx/IYz1KwEc sRFgAlgpiMUUJ8FezkjxsPamNLmKXGXMMnrWkkNBkhZYdTQ5aa+lB01RChW9TCty0wX9 445mIAVNqsD6AlnoSTVa1xZ9M0wqF1tu1mXR0l4VNIOJh/1Z7nrl6ZGqFpsEd+gbppMi JwJ/QAfOxEOrV+nf6Yy+mgcCA2ZEj2+9xTjaahqw88GUR2gFL2QqSSOBo4YeBJtHpCVz 6/3Q== 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; bh=GsAq7xNf+bkdex0pSug1EkyY6fyBIT+YzZtQzWaglxI=; b=Opi1J0xVKpbYflBFKmwDFF97baeum4g/VISGpSoFxI12ZWSCS1M035eW/d+f1qK8TQ 8okgDpUnzJ+1LEUVEAqFTc9UYd3KB1X+qhGTncqxPEHM6nsDokKMWp1GuhvgjZFOUZQK T86/Sv0jQ486qWr7d8QwxwSMxYoJGG6OZjb6wWwrk/3LOhbloHX9v3TxzVkspK8hAVJb MpnPT1TWHTTvGW5gfEZgZPzEtlkNevaROZHvzN5mtu6BRq3BTZk1tac3vtn9mZG7JTfO r5+FzQHbwUa64DtVlgLJHK3gvMU/7yGgtU+EEvoDbR9p4TZ7Iw3+Sh5PT5X7oCYFOtrA +frA== X-Gm-Message-State: AGRZ1gJgJOM6fTWwEU4M7xzEpxV3FLy9Y82YynIaDyyHtKtmLqCVDjHG TOM0MoDWIizOu5eT2mzJZ2U= X-Google-Smtp-Source: AJdET5fbB3M28oLHNxFO2sPAro4Y4Brf+UAbaSWfX841rKRQKpcTtElcfCgl/ahoMjBJN238486qPA== X-Received: by 2002:a62:1c1:: with SMTP id 184-v6mr10139358pfb.242.1540706828200; Sat, 27 Oct 2018 23:07:08 -0700 (PDT) Received: from localhost.localdomain ([2409:4071:210a:547b:a60f:5e67:90:ea3f]) by smtp.gmail.com with ESMTPSA id m25-v6sm8482793pgb.67.2018.10.27.23.07.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Oct 2018 23:07:07 -0700 (PDT) From: Bhumika Goyal To: dvhart@infradead.org, andy@infradead.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr, Bhumika Goyal Subject: [PATCH] platform/x86: wmi: declare device_type structure as constant Date: Sun, 28 Oct 2018 11:37:00 +0530 Message-Id: <20181028060700.22110-1-bhumirks@gmail.com> X-Mailer: git-send-email 2.14.5 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The only usage of device_type structure is getting stored as a reference in the type field of device structure. This type field is declared const. Therefore, the device_type structure can never be modified and can be declared as const. Signed-off-by: Bhumika Goyal --- drivers/platform/x86/wmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 04791ea5d97b..bea35be68706 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -987,19 +987,19 @@ static struct bus_type wmi_bus_type = { .remove = wmi_dev_remove, }; -static struct device_type wmi_type_event = { +static const struct device_type wmi_type_event = { .name = "event", .groups = wmi_event_groups, .release = wmi_dev_release, }; -static struct device_type wmi_type_method = { +static const struct device_type wmi_type_method = { .name = "method", .groups = wmi_method_groups, .release = wmi_dev_release, }; -static struct device_type wmi_type_data = { +static const struct device_type wmi_type_data = { .name = "data", .groups = wmi_data_groups, .release = wmi_dev_release,