From: Khalid Aziz <khalid@gonehiking.org>
To: jejb@linux.ibm.com, Deepak R Varma <drv@mailo.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Saurabh Singh Sengar <ssengar@microsoft.com>,
Praveen Kumar <kumarpraveen@linux.microsoft.com>
Subject: Re: [PATCH] scsi: FlashPoint: Replace arithmetic addition by bitwise OR
Date: Tue, 7 Feb 2023 08:28:22 -0700 [thread overview]
Message-ID: <47e6d710-d666-5f5b-5d65-4f31afe4359d@gonehiking.org> (raw)
In-Reply-To: <9a78cdd254d5d962450242d2e01c3a0f702a63a0.camel@linux.ibm.com>
On 2/7/23 05:26, James Bottomley wrote:
> On Tue, 2023-02-07 at 16:51 +0530, Deepak R Varma wrote:
>> When adding two bit-field mask values, an OR operation offers higher
>> performance over an arithmetic operation. So, convert such additions
>> to an OR based expressions. Issue identified using orplus.cocci
>> semantic patch script.
>
> No it doesn't, at least not for constants, which is the entirety of
> this patch: the compiler can find the value at compile time, so the
> whole lot becomes a load immediate of a single value. Whether the
> compiler sees OR or + is immaterial to the compile time computation.
> Perhaps Coccinelle should be fixed not to complain about this case?
>
> James
>
Agreed. This would be lot of code changes for no benefit.
--
Khalid
next prev parent reply other threads:[~2023-02-07 15:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 11:21 Deepak R Varma
2023-02-07 12:26 ` James Bottomley
2023-02-07 15:28 ` Khalid Aziz [this message]
2023-02-07 17:48 ` Deepak R Varma
2023-02-07 17:46 ` Deepak R Varma
2023-02-07 19:25 ` James Bottomley
2023-02-07 20:19 ` Martin K. Petersen
2023-02-09 7:32 ` Deepak R Varma
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=47e6d710-d666-5f5b-5d65-4f31afe4359d@gonehiking.org \
--to=khalid@gonehiking.org \
--cc=drv@mailo.com \
--cc=jejb@linux.ibm.com \
--cc=kumarpraveen@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ssengar@microsoft.com \
/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
all inboxes | Powered by JetHome®