mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.ibm.com>
To: Deepak R Varma <drv@mailo.com>,
	Khalid Aziz <khalid@gonehiking.org>,
	"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, 07 Feb 2023 15:26:48 +0300	[thread overview]
Message-ID: <9a78cdd254d5d962450242d2e01c3a0f702a63a0.camel@linux.ibm.com> (raw)
In-Reply-To: <Y+I0HXsHezZRtFOM@ubun2204.myguest.virtualbox.org>

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


  reply	other threads:[~2023-02-07 12:27 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 [this message]
2023-02-07 15:28   ` Khalid Aziz
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=9a78cdd254d5d962450242d2e01c3a0f702a63a0.camel@linux.ibm.com \
    --to=jejb@linux.ibm.com \
    --cc=drv@mailo.com \
    --cc=khalid@gonehiking.org \
    --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®