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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F23CFC25B74 for ; Thu, 16 May 2024 14:48:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z9X7e7OBP1MslLNtuu86baHbAO4V+H51ub8Wd4x5y5I=; b=HzWPalaod2jYJx BZjByPF/IBPAqYA37R+qThIOnx2Qau2rDz0a42oTJY4n37nQd5ihY6DGKx1pZUPySO1h0vTIdx8Mz gob704u5AB44nfUPsgalU9wk6t0ZRxZhp3VQe9pGqkQmqpvbIefm6lUpiBvdSDrmkpw9bZmG2pILb o1BAqVMC6oGMSW/Q9lRnr7wN7JUFj2YFoWywpApXUqbqNzEzZb+IwPTM4OgLhgxXi85TgQMv1GnaE GGhR02+T8O3haAG40YT3Ley/npXNvw6AqeFAKJQrValWj5/qWH+r1Uc5VjF6ysXOKHut1wdMBU5A5 O7dq9db+LJupEwtyM0GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7cPK-00000005Ccg-45I2; Thu, 16 May 2024 14:48:34 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7cPH-00000005CbQ-1OT9 for linux-arm-kernel@lists.infradead.org; Thu, 16 May 2024 14:48:33 +0000 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VgCYK2wGZz6J6mh; Thu, 16 May 2024 22:44:53 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id D29B4140A36; Thu, 16 May 2024 22:48:25 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 16 May 2024 15:48:25 +0100 Date: Thu, 16 May 2024 15:48:23 +0100 From: Jonathan Cameron To: Kousik Sanagavarapu CC: Nathan Chancellor , kernel test robot , Nishanth Menon , Santosh Shilimkar , Julia Lawall , , , Shuah Khan , Javier Carrasco , , Subject: Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup Message-ID: <20240516154823.00000974@Huawei.com> In-Reply-To: References: <20240510071432.62913-3-five231003@gmail.com> <202405111846.3m9z398l-lkp@intel.com> <20240513064451.GB652533@thelio-3990X> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240516_074831_720344_121AE704 X-CRM114-Status: GOOD ( 22.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 13 May 2024 12:53:27 +0530 Kousik Sanagavarapu wrote: > On Sun, May 12, 2024 at 11:44:51PM -0700, Nathan Chancellor wrote: > > On Sun, May 12, 2024 at 03:56:22PM +0530, Kousik Sanagavarapu wrote: > > > On Sat, May 11, 2024 at 06:12:39PM +0800, kernel test robot wrote: > > > > Hi Kousik, > > > > > > > > kernel test robot noticed the following build errors: > > > > > > > > > > [...] > > > > > > > All errors (new ones prefixed by >>): > > > > > > > > >> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label > > > > goto err; > > > > ^ > > > > drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup)) > > > > struct device_node *regions __free(device_node) = > > > > ^ > > [...] > > > > Seems like gcc didn't catch this when I compiled locally. > > > > FWIW, you may notice this as you do more conversions. The fact that GCC > > does not warn at all is a GCC bug as far as I am aware (i.e., clang's > > error is correct): > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951 > > > > which has come up in other places: > > > > https://lore.kernel.org/20240425174732.GA270911@dev-arch.thelio-3990X/ > > Thank you so much for these links :) > > All my internet searches ended up at stackoverflow posts which didn't > even describe the problem correctly, which also lead me to write an > email explaining a partly erroneous solution, which is sitting in my > mailbox ;) > > Thanks again, these will help a lot. Independent of all this, it's not a good idea form a readability point of view to mix automated and manual cleanup. So in cases like this where you want to do scope based cleanup, use separate functions that have appropriately defined scope (or brackets for the really minor cases). Here, you may just be able to push the device_node get into knav_queue_setup_regions() for example. Jonathan > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel