From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C859C28CC0 for ; Wed, 29 May 2019 14:21:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B7CD239C9 for ; Wed, 29 May 2019 14:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727130AbfE2OVK (ORCPT ); Wed, 29 May 2019 10:21:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:38472 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726889AbfE2OVK (ORCPT ); Wed, 29 May 2019 10:21:10 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 41F19AEDB; Wed, 29 May 2019 14:21:09 +0000 (UTC) From: Thomas Renninger To: ego@linux.vnet.ibm.com Cc: Abhishek Goel , shuah@kernel.org, LKML , Linux PM list Subject: Re: [PATCH] cpupower : frequency-set -r option misses the last cpu in related cpu list Date: Wed, 29 May 2019 16:21:08 +0200 Message-ID: <1825219.HmmgU4QcfA@house> In-Reply-To: References: <20190529093033.30068-1-huntbag@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, On Wednesday, May 29, 2019 2:12:34 PM CEST Gautham R Shenoy wrote: > Hi Abhishek, > > On Wed, May 29, 2019 at 3:02 PM Abhishek Goel ... > > bitmask_setbit(cpus_chosen, cpus->cpu); > > cpus = cpus->next; > > > > } > > > > + /* Set the last cpu in related cpus list */ > > + bitmask_setbit(cpus_chosen, cpus->cpu); > > Perhaps you could convert the while() loop to a do .. while(). That > should will ensure > that we terminate the loop after setting the last valid CPU. It would do exactly the same, right? IMHO it's not worth the extra hassle of resubmitting. Setting the last value outside a while loop is rather common. I do not have a CPU with related cores at hand. If you tested this it would be nice to see this pushed: Reviewed-by: Thomas Renninger Thanks! Thomas