Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13584066pxu; Sun, 3 Jan 2021 21:19:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtfpq+NrQmIznec9NQS4j7aoVErCgEAI1d/V1LLZCbn+XtNWUu2kJ2W8fSQJvwE8mViBHj X-Received: by 2002:a17:906:d152:: with SMTP id br18mr62033998ejb.297.1609737555333; Sun, 03 Jan 2021 21:19:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609737555; cv=none; d=google.com; s=arc-20160816; b=r4kaDbHavbL9j1w4KsnPp8hqw40RBMAIMmW8Vpm6ZiL/bFHfPk6zUG07p6k187twdf Nb828YiAANtSxqUdUNKOTLcOgnNPe39VO32m4ir81j4Hyj8GCqo/5a1qlBEa8DBvRySL x/WrmwY+0Uo5UWr7U6vNg6B3EtLV11rsmM4CiULlaH0pZDmUNYoupw4Ucs9tkjXny9JZ U89cwJXD1Oj/yxasA2YOVnfGUDkmNsCg9SJzJpxgGYYTJoYpe5qWVDrs+ja+LQMlhlpc 6wqMJlh3GfXaW6Hr7A7x4Ve0YFkjcg+zEUuWj/C/UkreMGFfmsHK6Ofwq15wOD8MNUn4 t5PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ZCuMqxaa10JYRmR10DhiM+h6PvnBnDtwZRJsY1l7Cdg=; b=iNQe1Fil/SpHYLeV4TZeUWl8jsMShbLrl7fxedHByLb4wB2N4PTEZ1PYIuIvB9k6Yl 18jqiYf/9SEkGiKbbkjP1gPFTjfSsPkStBUKNHs8j03eyhNZOHmoWNvp4+If9+TcopXk +GMNICcMTFzpQBDirHeSZ1JwAYlvZycZaiSVsbF+0+/TIfxEQTPhBY0dNuUMQ8Pmfg37 2a6eKsOALZh4S4CC4gnTpxHLYZZa7xQQwD9CJ9XhQWAyrEIRbyXa50FSjLuHDzZw9S2g 3EE4pJ26ZrXWKm6g09rv6cuRAruX6LnKaglNipogLiMo+MD45Tn5QIcjxrNyE6LzkavU Euzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id od20si28185500ejb.621.2021.01.03.21.18.51; Sun, 03 Jan 2021 21:19:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727791AbhADCAT (ORCPT + 99 others); Sun, 3 Jan 2021 21:00:19 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:9950 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727709AbhADCAT (ORCPT ); Sun, 3 Jan 2021 21:00:19 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4D8JhF39Nzzj1CZ; Mon, 4 Jan 2021 09:58:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Mon, 4 Jan 2021 09:59:33 +0800 From: Tian Tao To: CC: Subject: [PATCH] pcmcia: Switch to using the new API kobj_to_dev() Date: Mon, 4 Jan 2021 09:59:30 +0800 Message-ID: <1609725570-11433-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fixed the following coccicheck: drivers/pcmcia/cistpl.c:1557:54-55: WARNING opportunity for kobj_to_dev() drivers/pcmcia/cistpl.c:1584:53-54: WARNING opportunity for kobj_to_dev() Signed-off-by: Tian Tao --- drivers/pcmcia/cistpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index cf109d9..e693910 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c @@ -1554,7 +1554,7 @@ static ssize_t pccard_show_cis(struct file *filp, struct kobject *kobj, if (off + count > size) count = size - off; - s = to_socket(container_of(kobj, struct device, kobj)); + s = to_socket(kobj_to_dev(kobj)); if (!(s->state & SOCKET_PRESENT)) return -ENODEV; @@ -1581,7 +1581,7 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj, if (error) return error; - s = to_socket(container_of(kobj, struct device, kobj)); + s = to_socket(kobj_to_dev(kobj)); if (off) return -EINVAL; -- 2.7.4