From patchwork Thu Jul 30 09:34:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51684 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 1657922E7D for ; Thu, 30 Jul 2015 09:35:04 +0000 (UTC) Received: by lbcjj5 with SMTP id jj5sf12246438lbc.1 for ; Thu, 30 Jul 2015 02:35:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=unc5knf0Tt+eQVYlTcvYuTgaplWgmH6ETj2CWfFhblk=; b=WOyFiRxPCUTyo6hr4wxxRzBeXuZzPGs8OhBSvOUH6qOw3cD2qxlj4Guz/yNNc5QYH8 LU1X3sbwLFsrZTVFfClypSkjHbCqZ7e2vAxt0imE9R1tMxu9U1yT7HUIj9d58c2Su/lX 4Xe1KIdSqdmrdvswGh+baatuqGjDfenlDKQeqavCSG0tUWok5lqgfFiN7MvTjmEx0XoG r7Tb1u5HRtQOIgwmwvraFv14OpnPHtkC+eARl19YmhpopMB/HZFtFuJvRrATAJh+xCoV WDXZL37sttzg33h63RZbXOepdFegW+dBt6a20772bE/ylFZFnKNMul8CN5Gt4tsTWGCx o81A== X-Gm-Message-State: ALoCoQnI4wYHbnUm6Qq/aOnxPv5J/AWcuuEXoQ0orsJYajMkpJvwpR6MVjwfWulTImWmOWdtTKFe X-Received: by 10.152.182.226 with SMTP id eh2mr17420560lac.0.1438248903000; Thu, 30 Jul 2015 02:35:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.167 with SMTP id g7ls143286lae.75.gmail; Thu, 30 Jul 2015 02:35:02 -0700 (PDT) X-Received: by 10.152.44.130 with SMTP id e2mr42707879lam.14.1438248902802; Thu, 30 Jul 2015 02:35:02 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id ud5si388736lac.28.2015.07.30.02.35.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2015 02:35:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbyj8 with SMTP id yj8so23362805lbb.0 for ; Thu, 30 Jul 2015 02:35:02 -0700 (PDT) X-Received: by 10.112.120.134 with SMTP id lc6mr43529240lbb.86.1438248902675; Thu, 30 Jul 2015 02:35:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp450501lba; Thu, 30 Jul 2015 02:35:01 -0700 (PDT) X-Received: by 10.67.3.9 with SMTP id bs9mr104064936pad.136.1438248900713; Thu, 30 Jul 2015 02:35:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fo7si1238253pac.56.2015.07.30.02.34.58; Thu, 30 Jul 2015 02:35:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755212AbbG3Je5 (ORCPT + 26 others); Thu, 30 Jul 2015 05:34:57 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:33483 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbbG3Jey (ORCPT ); Thu, 30 Jul 2015 05:34:54 -0400 Received: by padck2 with SMTP id ck2so20860342pad.0 for ; Thu, 30 Jul 2015 02:34:54 -0700 (PDT) X-Received: by 10.66.66.166 with SMTP id g6mr105762991pat.157.1438248894423; Thu, 30 Jul 2015 02:34:54 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id q5sm1093017pde.56.2015.07.30.02.34.52 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 30 Jul 2015 02:34:53 -0700 (PDT) From: Viresh Kumar To: Greg Kroah-Hartman Cc: Rafael Wysocki , Viresh Kumar , Borislav Petkov , Chris Metcalf , Dmitry Torokhov , "H. Peter Anvin" , Ingo Molnar , Joe Perches , Joerg Roedel , linux-kernel@vger.kernel.org (open list), linux-pm@vger.kernel.org (open list:CPU FREQUENCY DRIVERS), linux-sh@vger.kernel.org (open list:SUPERH), "Luis R. Rodriguez" , netdev@vger.kernel.org (open list:NETWORKING DRIVERS), Nicolas Iooss , Paul Gortmaker , Thomas Gleixner , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH] bus: subsys: update return type of ->remove_dev() to void Date: Thu, 30 Jul 2015 15:04:01 +0530 Message-Id: <02c0569741812b655edde5124c3e2937bb79f9f8.1438248445.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Its return value is not used by the subsys core and nothing meaningful can be done with it, even if we want to use it. The subsys device is anyway getting removed. Update prototype of ->remove_dev() to make its return type as void. Fix all usage sites as well. Signed-off-by: Viresh Kumar --- Based of 4.2-rc4. --- arch/sh/kernel/cpu/sh4/sq.c | 3 +-- arch/tile/kernel/sysfs.c | 11 ++++------- arch/x86/kernel/cpu/microcode/core.c | 5 ++--- drivers/cpufreq/cpufreq.c | 12 +++++------- drivers/net/rionet.c | 4 +--- include/linux/device.h | 2 +- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index 0a47bd3e7bee..4ca78ed71ad2 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c @@ -355,13 +355,12 @@ static int sq_dev_add(struct device *dev, struct subsys_interface *sif) return error; } -static int sq_dev_remove(struct device *dev, struct subsys_interface *sif) +static void sq_dev_remove(struct device *dev, struct subsys_interface *sif) { unsigned int cpu = dev->id; struct kobject *kobj = sq_kobject[cpu]; kobject_put(kobj); - return 0; } static struct subsys_interface sq_interface = { diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c index a3ed12f8f83b..825867c53853 100644 --- a/arch/tile/kernel/sysfs.c +++ b/arch/tile/kernel/sysfs.c @@ -198,16 +198,13 @@ static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif) return err; } -static int hv_stats_device_remove(struct device *dev, - struct subsys_interface *sif) +static void hv_stats_device_remove(struct device *dev, + struct subsys_interface *sif) { int cpu = dev->id; - if (!cpu_online(cpu)) - return 0; - - sysfs_remove_file(&dev->kobj, &dev_attr_hv_stats.attr); - return 0; + if (cpu_online(cpu)) + sysfs_remove_file(&dev->kobj, &dev_attr_hv_stats.attr); } diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 6236a54a63f4..3c986390058a 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -377,17 +377,16 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif) return err; } -static int mc_device_remove(struct device *dev, struct subsys_interface *sif) +static void mc_device_remove(struct device *dev, struct subsys_interface *sif) { int cpu = dev->id; if (!cpu_online(cpu)) - return 0; + return; pr_debug("CPU%d removed\n", cpu); microcode_fini_cpu(cpu); sysfs_remove_group(&dev->kobj, &mc_attr_group); - return 0; } static struct subsys_interface mc_cpu_interface = { diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 26063afb3eba..6da25c10bdfd 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1518,7 +1518,7 @@ static int __cpufreq_remove_dev_finish(struct device *dev, * * Removes the cpufreq interface for a CPU device. */ -static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) +static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) { unsigned int cpu = dev->id; int ret; @@ -1533,7 +1533,7 @@ static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) struct cpumask mask; if (!policy) - return 0; + return; cpumask_copy(&mask, policy->related_cpus); cpumask_clear_cpu(cpu, &mask); @@ -1544,19 +1544,17 @@ static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) */ if (cpumask_intersects(&mask, cpu_present_mask)) { remove_cpu_dev_symlink(policy, cpu); - return 0; + return; } cpufreq_policy_free(policy, true); - return 0; + return; } ret = __cpufreq_remove_dev_prepare(dev, sif); if (!ret) - ret = __cpufreq_remove_dev_finish(dev, sif); - - return ret; + __cpufreq_remove_dev_finish(dev, sif); } static void handle_update(struct work_struct *work) diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index dac7a0d9bb46..01f08a7751f7 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c @@ -396,7 +396,7 @@ static int rionet_close(struct net_device *ndev) return 0; } -static int rionet_remove_dev(struct device *dev, struct subsys_interface *sif) +static void rionet_remove_dev(struct device *dev, struct subsys_interface *sif) { struct rio_dev *rdev = to_rio_dev(dev); unsigned char netid = rdev->net->hport->id; @@ -416,8 +416,6 @@ static int rionet_remove_dev(struct device *dev, struct subsys_interface *sif) } } } - - return 0; } static void rionet_get_drvinfo(struct net_device *ndev, diff --git a/include/linux/device.h b/include/linux/device.h index a2b4ea70a946..1225f98e9240 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -341,7 +341,7 @@ struct subsys_interface { struct bus_type *subsys; struct list_head node; int (*add_dev)(struct device *dev, struct subsys_interface *sif); - int (*remove_dev)(struct device *dev, struct subsys_interface *sif); + void (*remove_dev)(struct device *dev, struct subsys_interface *sif); }; int subsys_interface_register(struct subsys_interface *sif);