From patchwork Wed Aug 26 20:54:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11740065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE36713A4 for ; Thu, 27 Aug 2020 06:58:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6C5222B4E for ; Thu, 27 Aug 2020 06:58:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6C5222B4E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 76DE46EB2F; Thu, 27 Aug 2020 06:57:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 428 seconds by postgrey-1.36 at gabe; Wed, 26 Aug 2020 21:01:16 UTC Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8AE9B6EAF0 for ; Wed, 26 Aug 2020 21:01:16 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.76,357,1592863200"; d="scan'208";a="464849659" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Aug 2020 22:54:06 +0200 Date: Wed, 26 Aug 2020 22:54:05 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Denis Efremov , Bernie Thompson , Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kbuild-all@lists.01.org Subject: [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 27 Aug 2020 06:57:36 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: kernel test robot Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci Fixes: a2fc3718bc22 ("coccinelle: api: add kobj_to_dev.cocci script") CC: Denis Efremov Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10 head: a2fc3718bc22e85378085568ecc5765fb28cabce commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/3] coccinelle: api: add kobj_to_dev.cocci script :::::: branch date: 5 days ago :::::: commit date: 5 days ago udlfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1457,7 +1457,7 @@ static ssize_t edid_show( struct file *filp, struct kobject *kobj, struct bin_attribute *a, char *buf, loff_t off, size_t count) { - struct device *fbdev = container_of(kobj, struct device, kobj); + struct device *fbdev = kobj_to_dev(kobj); struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; @@ -1479,7 +1479,7 @@ static ssize_t edid_store( struct file *filp, struct kobject *kobj, struct bin_attribute *a, char *src, loff_t src_off, size_t src_size) { - struct device *fbdev = container_of(kobj, struct device, kobj); + struct device *fbdev = kobj_to_dev(kobj); struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; int ret;