Closed Bug 1468036 Opened 6 years ago Closed 6 years ago

RuntimeService::ClampedHardwareConcurrency() : Calling clampedHardwareConcurrency.compareExchange(0U, clampedValue) is only useful for its return value, which is ignored.

Categories

(Core :: DOM: Service Workers, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: Sylvestre, Assigned: baku)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: [CID 1436892])

Attachments

(1 file)

Coverity thinks that  this line:
https://dxr.mozilla.org/mozilla-central/source/dom/workers/RuntimeService.cpp?q=clampedHardwareConcurrency.compareExchange&redirect_type=single#2565
is useless

It seems that it is the case as the implementation of compareExchange is:
  bool compareExchange(T aOldValue, T aNewValue)
  {
    return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);
  }

Would mean that a few lines of code are not doing that they are supposed to.
Andrea, what do you think?
Flags: needinfo?(amarchesini)
Attached patch compare.patchSplinter Review
There is a comment to explain what that block of code does, but let's use Unused to make the static analysis happy.
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
Attachment #8985162 - Flags: review?(sledru)
Priority: -- → P2
Summary: RuntimeService::ClampedHardwareConcurrency() : Calling clampedHardwareConcurrency.compareExchange(0U, clampedValue) is only useful for its return value, which is ignored. [show details] → RuntimeService::ClampedHardwareConcurrency() : Calling clampedHardwareConcurrency.compareExchange(0U, clampedValue) is only useful for its return value, which is ignored.
Attachment #8985162 - Flags: review?(sledru) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/231d843c855b
Fix a warning in RuntimeService::ClampedHardwareConcurrency(), r=sylvestre
https://hg.mozilla.org/mozilla-central/rev/231d843c855b
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: