From patchwork Wed Mar 17 12:00:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12145593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1500AC433E0 for ; Wed, 17 Mar 2021 12:01:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD31164EB9 for ; Wed, 17 Mar 2021 12:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231450AbhCQMBA (ORCPT ); Wed, 17 Mar 2021 08:01:00 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:5849 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231453AbhCQMA3 (ORCPT ); Wed, 17 Mar 2021 08:00:29 -0400 IronPort-HdrOrdr: A9a23:gIihj6P6wYoB2sBcTgGjsMiAIKoaSvp033AA0UdtRRtJNvGJjszGpoV46TbYgCscMUtKpfmuI6+FKEm3ybdQwa08eYivRxPnvmzAFvAA0aLHzyf7EyPzss5xvJ0AT4FEBNf9DUd3gK/BiWGFOuw9y9qK+r3Av4nj5kpqJDsHV4hd9QtjTi6UHkpqLTMnObMJUKvZ3MZBqja6EE57Uu2wDBA+MNT+mw== X-IronPort-AV: E=Sophos;i="5.81,256,1610406000"; d="scan'208";a="376004234" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Mar 2021 13:00:27 +0100 Date: Wed, 17 Mar 2021 13:00:26 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Corentin Chary , Darren Hart , Andy Shevchenko , acpi4asus-user@lists.sourceforge.net cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, Denis Efremov Subject: [PATCH] asus-laptop: fix kobj_to_dev.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org From: kernel test robot Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1df27313f50a57497c1faeb6a6ae4ca939c85a7d commit: a2fc3718bc22e85378085568ecc5765fb28cabce coccinelle: api: add kobj_to_dev.cocci script :::::: branch date: 5 hours ago :::::: commit date: 7 months ago asus-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1569,7 +1569,7 @@ static umode_t asus_sysfs_is_visible(str struct attribute *attr, int idx) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct asus_laptop *asus = dev_get_drvdata(dev); acpi_handle handle = asus->handle; bool supported;