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 AE12EC77B73 for ; Mon, 5 Jun 2023 22:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232296AbjFEWQY (ORCPT ); Mon, 5 Jun 2023 18:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbjFEWQX (ORCPT ); Mon, 5 Jun 2023 18:16:23 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA3310B; Mon, 5 Jun 2023 15:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686003379; x=1717539379; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=j6OmYXev5dSof4jSEuXxwO0jYGsXKhESRMOiQiPGbO8=; b=mC6TBdQLFdpYDYhvAwVefcc6CubhmVJbtt8JgmfYE7ODIWhMZ99FprbB zrkGvmNM8NmdDnsu8yJuSNx1iDJb9oeeXTzBF19RN+SxZAOCGn+JbHU/s KwxWALxTO0wcAHJazhztoKJe7bwZrMySWcHpKhqy69VUOPfADaLha2oqo +utgT/T1mKQx2UJZ7P5r9+DXmvNJm574ENKJLACdJIYWJv6RDSfrDpvrW wKkjEx0+1pb2yHttBGb0hb7i5nnjIP604VpvYRPrYOTPzTU4jf1Rt8Rgr 1Ow4MHDpYEHuz0kX7yHmBKQ+tkyv3ikRRdY56NEUQc329quCy2F/M5FtZ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="359812693" X-IronPort-AV: E=Sophos;i="6.00,218,1681196400"; d="scan'208";a="359812693" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 15:16:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="686267039" X-IronPort-AV: E=Sophos;i="6.00,218,1681196400"; d="scan'208";a="686267039" Received: from twgeistx-mobl.ger.corp.intel.com (HELO intel.com) ([10.249.42.176]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 15:16:09 -0700 Date: Tue, 6 Jun 2023 00:16:04 +0200 From: Andi Shyti To: 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 , Sui Jingfeng , 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 Subject: Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix Message-ID: References: <20230604205831.3357596-1-15330273260@189.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230604205831.3357596-1-15330273260@189.cn> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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. > 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 > 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. Andi