From patchwork Wed Jan 9 06:29:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rajagopal.venkat@linaro.org X-Patchwork-Id: 13936 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6ADB323FB3 for ; Wed, 9 Jan 2013 06:33:40 +0000 (UTC) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by fiordland.canonical.com (Postfix) with ESMTP id 105B1A180C3 for ; Wed, 9 Jan 2013 06:33:39 +0000 (UTC) Received: by mail-vb0-f48.google.com with SMTP id fc21so1234978vbb.35 for ; Tue, 08 Jan 2013 22:33:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=WLAfiDviEfm+oO+R981c66zZLRgbhDfjImC2VudGYxs=; b=jFwG9B9fmtnjx2nJpqZCg/9HMPzu1Giff9b1k4cTuIkOqmpbUKZCotCV2IlJL/bHSI dRFAPnuFnba+DPQ+1gLGIDLmmOGtp/3K5v+1ERuEnykHD2SF9FBMHX3ZD61l6iZ2tiu4 fnS4SRlHXIxczILzR98aNaBAiJTxWa9wrEcWg8SxPOatylYOFD7SVExofOj+mQ2uFeOl FnyEqDIek2qLPW4rpBKH+L8joPaDOCerwlyJLNhWhxJcPWHXEkujpbeY8mab6Fs26xbL YlX0zCaTyC4sXdCRUffWl4wt/++jvl35sah8IjeJuVg/QC/D2Vzw5Wgi7SQfjK4Mymph gE+w== X-Received: by 10.220.238.139 with SMTP id ks11mr86576157vcb.49.1357713219306; Tue, 08 Jan 2013 22:33:39 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp149563veb; Tue, 8 Jan 2013 22:33:38 -0800 (PST) X-Received: by 10.66.80.202 with SMTP id t10mr186256645pax.81.1357713215059; Tue, 08 Jan 2013 22:33:35 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id sn9si65040685pbc.339.2013.01.08.22.33.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 22:33:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of rajagopal.venkat@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of rajagopal.venkat@linaro.org) smtp.mail=rajagopal.venkat@linaro.org Received: by mail-pb0-f45.google.com with SMTP id mc8so740302pbc.32 for ; Tue, 08 Jan 2013 22:33:34 -0800 (PST) X-Received: by 10.68.132.232 with SMTP id ox8mr206352148pbb.46.1357713214395; Tue, 08 Jan 2013 22:33:34 -0800 (PST) Received: from localhost.localdomain ([115.241.54.71]) by mx.google.com with ESMTPS id vk5sm41053654pbc.34.2013.01.08.22.33.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 22:33:33 -0800 (PST) From: Rajagopal Venkat To: mturquette@linaro.org Cc: patches@linaro.org, linaro-dev@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Rajagopal Venkat Subject: [PATCH] clk: remove unreachable code Date: Wed, 9 Jan 2013 11:59:48 +0530 Message-Id: <1357712988-22317-1-git-send-email-rajagopal.venkat@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357650191-30842-1-git-send-email-rajagopal.venkat@linaro.org> References: <1357650191-30842-1-git-send-email-rajagopal.venkat@linaro.org> X-Gm-Message-State: ALoCoQm5NfThJ1CnqNC2hqFzJd0t7vceRxM/82ouviunBE4fyr3iwX09O4Q1+wxXYNp9gC0RP8P8 while reparenting a clock, NULL check is done for clock in consideration and its new parent. So re-check is not required. If done, else part becomes unreachable. Signed-off-by: Rajagopal Venkat --- drivers/clk/clk.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 251e45d..1c4097c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1040,7 +1040,6 @@ void __clk_reparent(struct clk *clk, struct clk *new_parent) { #ifdef CONFIG_COMMON_CLK_DEBUG struct dentry *d; - struct dentry *new_parent_d; #endif if (!clk || !new_parent) @@ -1048,22 +1047,14 @@ void __clk_reparent(struct clk *clk, struct clk *new_parent) hlist_del(&clk->child_node); - if (new_parent) - hlist_add_head(&clk->child_node, &new_parent->children); - else - hlist_add_head(&clk->child_node, &clk_orphan_list); + hlist_add_head(&clk->child_node, &new_parent->children); #ifdef CONFIG_COMMON_CLK_DEBUG if (!inited) goto out; - if (new_parent) - new_parent_d = new_parent->dentry; - else - new_parent_d = orphandir; - d = debugfs_rename(clk->dentry->d_parent, clk->dentry, - new_parent_d, clk->name); + new_parent->dentry, clk->name); if (d) clk->dentry = d; else