public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Kousik Sanagavarapu <five231003@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
	kernel test robot <lkp@intel.com>, Nishanth Menon <nm@ti.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Julia Lawall <julia.lawall@inria.fr>, <llvm@lists.linux.dev>,
	<oe-kbuild-all@lists.linux.dev>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
Date: Thu, 16 May 2024 15:48:23 +0100	[thread overview]
Message-ID: <20240516154823.00000974@Huawei.com> (raw)
In-Reply-To: <ZkG_7wJvIjZ4ZlcV@five231003>

On Mon, 13 May 2024 12:53:27 +0530
Kousik Sanagavarapu <five231003@gmail.com> 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


  reply	other threads:[~2024-05-16 14:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  7:13 [PATCH 0/3] Use scope based cleanup in drivers/soc/ti/ Kousik Sanagavarapu
2024-05-10  7:13 ` [PATCH 1/3] soc: ti: pruss: do device_node auto cleanup Kousik Sanagavarapu
2024-05-16 14:41   ` Jonathan Cameron
2024-05-10  7:13 ` [PATCH 2/3] soc: ti: knav_qmss_queue: " Kousik Sanagavarapu
2024-05-11 10:12   ` kernel test robot
2024-05-12 10:26     ` Kousik Sanagavarapu
2024-05-12 10:36       ` Julia Lawall
2024-05-13  6:44       ` Nathan Chancellor
2024-05-13  7:23         ` Kousik Sanagavarapu
2024-05-16 14:48           ` Jonathan Cameron [this message]
2024-05-10  7:13 ` [PATCH 3/3] soc: ti: pm33xx: " Kousik Sanagavarapu
2024-05-11  9:06 ` [PATCH 0/3] Use scope based cleanup in drivers/soc/ti/ Kousik Sanagavarapu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240516154823.00000974@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=five231003@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=julia.lawall@inria.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=nm@ti.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=skhan@linuxfoundation.org \
    --cc=ssantosh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox