From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754564AbcFPN0m (ORCPT ); Thu, 16 Jun 2016 09:26:42 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:37144 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754534AbcFPN0k (ORCPT ); Thu, 16 Jun 2016 09:26:40 -0400 MIME-Version: 1.0 In-Reply-To: <20160616124818.GN5726@vireshk-i7> References: <87bd097db7b673b1f75ca2086dfa76f4dfbf7f8c.1466058619.git.viresh.kumar@linaro.org> <20160616124818.GN5726@vireshk-i7> From: "Rafael J. Wysocki" Date: Thu, 16 Jun 2016 15:26:33 +0200 X-Google-Sender-Auth: FmXLkQmi8_p5Gzb-rOaXO-hI2qE Message-ID: Subject: Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared To: Viresh Kumar Cc: "Rafael J. Wysocki" , Rafael Wysocki , acourbot@nvidia.com, Viresh Kumar , Nishanth Menon , Stephen Boyd , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Alexandre Courbot , linux-tegra@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 16, 2016 at 2:48 PM, Viresh Kumar wrote: > On 16-06-16, 14:25, Rafael J. Wysocki wrote: >> On Thu, Jun 16, 2016 at 8:33 AM, Viresh Kumar wrote: >> > + if (opp_table->shared_opp == OPP_TABLE_IS_SHARED) >> > + return opp_table; >> > + >> > + return NULL; >> >> That still can be >> >> return opp_table->shared_opp == OPP_TABLE_IS_SHARED ? opp_table : NULL; >> >> > } >> > } >> > > >> > + if (of_property_read_bool(opp_np, "opp-shared")) >> > + opp_table->shared_opp = OPP_TABLE_IS_SHARED; >> > + else >> > + opp_table->shared_opp = OPP_TABLE_IS_NOT_SHARED; >> >> And here >> >> opp_table->shared_opp = of_property_read_bool(opp_np, "opp-shared") ? >> OPP_TABLE_IS_SHARED : >> OPP_TABLE_IS_NOT_SHARED; > > Conditional statement for both these cases is getting very long and > if/else looks much more readable. And so I would like to stick with > that, if you allow. Fair enough.