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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43B62C7EE2C for ; Tue, 6 Jun 2023 02:06:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233585AbjFFCGa (ORCPT ); Mon, 5 Jun 2023 22:06:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbjFFCGX (ORCPT ); Mon, 5 Jun 2023 22:06:23 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4CC6A114; Mon, 5 Jun 2023 19:06:20 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8Dx9vCblH5kS1UAAA--.1029S3; Tue, 06 Jun 2023 10:06:19 +0800 (CST) Received: from [10.20.42.43] (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxZuSXlH5kIp0BAA--.7051S3; Tue, 06 Jun 2023 10:06:17 +0800 (CST) Message-ID: Date: Tue, 6 Jun 2023 10:06:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix To: Andi Shyti , Sui Jingfeng <15330273260@189.cn> Cc: Alex Deucher , Christian Konig , Pan Xinhui , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Ben Skeggs , Karol Herbst , Lyude Paul , Bjorn Helgaas , Alex Williamson , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Hawking Zhang , Mario Limonciello , Lijo Lazar , YiPeng Chai , Andrey Grodzovsky , Somalapuram Amaranath , Bokun Zhang , Ville Syrjala , Li Yi , Jason Gunthorpe , Kevin Tian , Cornelia Huck , Yishai Hadas , Abhishek Sahu , Yi Liu , kvm@vger.kernel.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, loongson-kernel@lists.loongnix.cn, amd-gfx@lists.freedesktop.org, linux-pci@vger.kernel.org References: <20230604205831.3357596-1-15330273260@189.cn> Content-Language: en-US From: Sui Jingfeng Organization: Loongson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8AxZuSXlH5kIp0BAA--.7051S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWxXFWkWw4DZFyfKFWDAw47Awc_yoW5XryDpF Zakas5Cw4kJrs7ZFy2qF4UJF1ruws3JFy7ArZIk3s7AF13J348JFsxCrZ8Z3y3XryfuF40 vr4UWr1DGayDZagCm3ZEXasCq-sJn29KB7ZKAUJUUUUJ529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUPqb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAaw2AFwI0_Jw0_GFyle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2 xF0cIa020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ Jw0_WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwI xGrwCYjI0SjxkI62AI1cAE67vIY487MxkF7I0En4kS14v26rWY6Fy7MxAIw28IcxkI7VAK I48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v26r1q6r43MI8I3I0E5I8CrV AFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWrXVW8Jr1l IxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxV AFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j 6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07bUzu AUUUUU= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2023/6/6 06:16, Andi Shyti wrote: > Hi Sui, > > On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote: >> From: Sui Jingfeng >> >> To keep consistent with vga_iostate_to_str() function, the third argument >> of vga_str_to_iostate() function should be 'unsigned int *'. > I think the real reason is not to keep consistent with > vga_iostate_to_str() but because vga_str_to_iostate() is actually > only taking "unsigned int *" parameters. Yes, right. my expression is not completely correct, I will update it at next version. I think, we have the same opinion. Originally, I also want to express the opinion. Because, it make no sense to  interpret the return value (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) as int type. IO state should be should be donate by a unsigned type. vga_iostate_to_str() also receive unsigned type. static const char *vga_iostate_to_str(unsigned int iostate) >> Signed-off-by: Sui Jingfeng >> --- >> drivers/pci/vgaarb.c | 29 +++++++++++++++-------------- >> include/linux/vgaarb.h | 8 +++----- >> 2 files changed, 18 insertions(+), 19 deletions(-) >> >> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c >> index 5a696078b382..e40e6e5e5f03 100644 >> --- a/drivers/pci/vgaarb.c >> +++ b/drivers/pci/vgaarb.c >> @@ -61,7 +61,6 @@ static bool vga_arbiter_used; >> static DEFINE_SPINLOCK(vga_lock); >> static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue); >> >> - > drop this change OK, This is a double blank line. Originally, I intend to accumulate all tiny fix, commit together. As they are trivial. Now, Should I split this patch, then this patch set will contain two trivial patch ? >> static const char *vga_iostate_to_str(unsigned int iostate) >> { >> /* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */ >> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate) >> return "none"; >> } >> >> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state) >> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state) > this is OK, it's actually what you are describing in the commit > log, but... > >> { >> - /* we could in theory hand out locks on IO and mem >> - * separately to userspace but it can cause deadlocks */ >> + /* >> + * we could in theory hand out locks on IO and mem >> + * separately to userspace but it can cause deadlocks >> + */ > ... all the rest needs to go on different patches as it doesn't > have anything to do with what you describe. OK, I will wait a few days for more reviews, I process them together,   also avoid version grow too fast. Thanks. > Andi -- Jingfeng