lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a97e7851-31f7-e493-fe1a-749f27c879f0@inria.fr>
Date: Wed, 9 Apr 2025 11:39:13 -0400 (EDT)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Erick Karanja <karanja99erick@...il.com>
cc: gregkh@...uxfoundation.org, outreachy@...ts.linux.dev, 
    philipp.g.hortmann@...il.com, linux-staging@...ts.linux.dev, 
    linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] staging: rtl8723bs: Improve code readability

> > > @@ -729,10 +721,9 @@ static void hal_ReadEFuse_WiFi(
> > >  		}
> > >
> > >  		if (offset < EFUSE_MAX_SECTION_8723B) {
> > > -			u16 addr;
> > > +			u16 addr = offset * PGPKT_DATA_SIZE;
> > >  			/*  Get word enable value from PG header
> > > */
> > >
> > > -			addr = offset * PGPKT_DATA_SIZE;
> >
> > I'm not sure about this one, due to the comment.
> Hello Julia, I have observed in some scenarios where the semantic patch
> deletes the comments that exist between the declaration and
> initialization which I think it's not okay and in this scenario where
> the comments are left dangling such as this. How do I go about this
> instances.
> Thank you.

Making the right choice depends on the semantics of the comment, which is
out of the scope of Coccinelle.  Generally, if a complete block of code is
dropped, any comments within it are dropped as well.  Here the comment is
kept, which seems reasonable.  The issue is that you may have moved code
that is relevant to the comment up above the comment.  Ultimately, you have
to decide what to do and what not to do.  If you let Coccinelle make a
patch, and then apply the patch, in the meantime you can just remove the
parts of the patch you don't like.  If you make the changes in place, you
can use git add -p to add the changes you like, and not add the others, and
then use git checkout to remove the changes you don't want to do.  I would
take the former approach, but some people may take the latter.

julia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ