Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead assignments inside CSCRawToDigi #26574

Merged

Conversation

perrotta
Copy link
Contributor

PR description:

A few dead assignments are reported by the static analyzer in the CSCRawToDigi package.
They are removed here.

However, they are sometimes so trivial, that I wonder whether they were left as such on purpose, for a reason that escapes my comprehension. That's why I would like to ask for the endorsement of the CSC reco contact, @ptcox , before signing this PR for reco.

PR validation:

It builds

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

bool fTMB_MiniScope = false;
bool fTMB_RPC = false;
bool fTMB_BlockedCFEBs = false;

fTMB_Scope = fTMB_Scope && true; // WARNING in 5_0_X
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the original intention of this line?

int NRPCtbins = 0; // =VB= number of RPC tbins

int b0cLine=0;///assumes that buf starts at the tmb data
///this is not true if something is wrong in the data
///before TMB - then we skip the whole event

NHeaderFrames++; NHeaderFrames--;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the original intention of this line?

@@ -277,7 +271,6 @@ void CSCDDUEventData::unpack_data(const uint16_t *buf, CSCDCCExaminer* examiner)

}
theSizeInWords = dduBufSize+12;
buf=inputBuf+dduBufSize;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the intention was to modify the pointer passed to this function, then it should have been passed by reference.
Otherwise, I agree with the static analyzer that this is a dead assignment as such, and it can be removed

@perrotta
Copy link
Contributor Author

please test

@ptcox
Copy link
Contributor

ptcox commented Apr 30, 2019 via email

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26574/9493

  • This PR adds an extra 32KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 30, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/34416/console Started: 2019/04/30 13:38

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @perrotta for master.

It involves the following packages:

EventFilter/CSCRawToDigi

@perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @ptcox, @barvic this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@barvic
Copy link
Contributor

barvic commented Apr 30, 2019

@perrotta It looks like most of those old code lines were used as a way to prevent compiler warnings about currently unused variables, instead of commenting it out. Most likely those variables are for not fully implemented features, which were in plans initially, but were later considered as not really needed or important for actual system operation.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-26574/34416/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3 differences found in the comparisons
  • DQMHistoTests: Total files compared: 33
  • DQMHistoTests: Total histograms compared: 3211964
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3211759
  • DQMHistoTests: Total skipped: 204
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 32 files compared)
  • Checked 137 log files, 14 edm output root files, 33 DQM output files

@perrotta
Copy link
Contributor Author

@perrotta It looks like most of those old code lines were used as a way to prevent compiler warnings about currently unused variables, instead of commenting it out. Most likely those variables are for not fully implemented features, which were in plans initially, but were later considered as not really needed or important for actual system operation.

Thank you @barvic
Do I understand correctly that you agree with cleaning the code as proposed in this PR, and silence out with it the static analyzer?

@barvic
Copy link
Contributor

barvic commented Apr 30, 2019

@perrotta It looks like most of those old code lines were used as a way to prevent compiler warnings about currently unused variables, instead of commenting it out. Most likely those variables are for not fully implemented features, which were in plans initially, but were later considered as not really needed or important for actual system operation.

Thank you @barvic
Do I understand correctly that you agree with cleaning the code as proposed in this PR, and silence out with it the static analyzer?

@perotta As I see that comparison tests are passed so far, then it is OK with me.

@perrotta
Copy link
Contributor Author

+1

  • Technical: just some dead wood cut away
  • Jenkins tests pass

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@fabiocos
Copy link
Contributor

fabiocos commented May 1, 2019

+1

@cmsbuild cmsbuild merged commit d84aef2 into cms-sw:master May 1, 2019
@perrotta perrotta deleted the removeDeadAssignmentsFromCSCRawToDigi branch May 13, 2019 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants