Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp631880pxj; Thu, 27 May 2021 08:14:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu0nlsJm7xXO1nlFnsEYIlQYMfBdhbjKY7NKnMKMvzEcEA3+BEUhnXqGBllBw6DhvfHlkZ X-Received: by 2002:a05:6602:2013:: with SMTP id y19mr3224398iod.71.1622128482894; Thu, 27 May 2021 08:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622128482; cv=none; d=google.com; s=arc-20160816; b=VFJtv/l7xtWmPVHTlkvU4BLfWs0rLjYnSBv1wBs1WOh5WT0JpqJK0z9/0tGUdH1WKm fr7rVcal2DDFC27VSBYMFN0Fc8aRo8flaqXOcBpuzyFAxHvH/MJ8lIo/5mhUjxjLK15h /huhQL1+Q54Lg3AlZKSP0ibsTFzW+L4PRZSBJdnve1Q/YoMER+JeK8rtp2ZuGMhr/FNF xp98byQwl/yKLlpnDEK7p1H2JQsU8e7K3/viwrykmxTO8FawHOdnHiVAA7ot0IiFqKMl o59eiXP1HyLWXftq05o6zwzOp8oOE/i77NsrYsEx69LTkK5t51yMzTAeFNZ+aK9vh+70 sGrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Bl6Ysh5gbciIOXRhD/aKEPLtXIXGMMEGDE5Ky6GMkv4=; b=QswM1uuXzQAw0SkYchHrd/UjF5PJuWPlWPt7trp8jhXWBEk4WcBpZwcJOOyH9o/R/O MUcwvk0vIQj1gygCEv4Jjopt2JROQziBTFc+oEDpCjEQorVcr7tl68XWhIX0wN39uGcU NNJtCJzGXgP6ndjqx6MdS31BmYqfnPku1LH6uzRR5qDmItcYanPoveXFM8geoYAYwPKb YIitrRT5qcJ2hriISaRG3Ja7tqcWhahBrZu2jdCGtm111e98aGpFJfjn7gjSjTl/aGC+ IuOIW7PYw406u9QsQHTjniGwh9KACuKB2ccyh2uku0VSnQJ/Vy7kT2CDlMQEA7ERJ1Uo UYDg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si2338693ilj.7.2021.05.27.08.14.28; Thu, 27 May 2021 08:14:42 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235707AbhE0JHA (ORCPT + 99 others); Thu, 27 May 2021 05:07:00 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:2311 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235690AbhE0JG7 (ORCPT ); Thu, 27 May 2021 05:06:59 -0400 Received: from dggeml706-chm.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4FrMH64bSmz19VRg; Thu, 27 May 2021 17:00:50 +0800 (CST) Received: from dggpeml500020.china.huawei.com (7.185.36.88) by dggeml706-chm.china.huawei.com (10.3.17.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 27 May 2021 17:05:25 +0800 Received: from huawei.com (10.175.127.227) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 27 May 2021 17:05:24 +0800 From: Baokun Li To: , , CC: , , , , Subject: [PATCH -next] driver core: Remove set but not used variable 'no_warn' Date: Thu, 27 May 2021 17:14:53 +0800 Message-ID: <20210527091453.3880695-1-libaokun1@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500020.china.huawei.com (7.185.36.88) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes gcc '-Wunused-but-set-variable' warning: drivers/base/module.c: In function 'module_create_drivers_dir': drivers/base/module.c:36:6: warning: variable ‘no_warn’ set but not used [-Wunused-but-set-variable] It never used since introduction. Signed-off-by: Baokun Li --- drivers/base/module.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/base/module.c b/drivers/base/module.c index 46ad4d636731..07ecd66b12b0 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c @@ -33,7 +33,6 @@ static void module_create_drivers_dir(struct module_kobject *mk) void module_add_driver(struct module *mod, struct device_driver *drv) { char *driver_name; - int no_warn; struct module_kobject *mk = NULL; if (!drv) @@ -59,12 +58,12 @@ void module_add_driver(struct module *mod, struct device_driver *drv) return; /* Don't check return codes; these calls are idempotent */ - no_warn = sysfs_create_link(&drv->p->kobj, &mk->kobj, "module"); + sysfs_create_link(&drv->p->kobj, &mk->kobj, "module"); driver_name = make_driver_name(drv); if (driver_name) { module_create_drivers_dir(mk); - no_warn = sysfs_create_link(mk->drivers_dir, &drv->p->kobj, - driver_name); + sysfs_create_link(mk->drivers_dir, &drv->p->kobj, + driver_name); kfree(driver_name); } } -- 2.25.4