Skip to content

fix: remove cal-1.0_10.RULE to prevent false positive on C calibration macros#4759

Open
dikshaa2909 wants to merge 1 commit intoaboutcode-org:developfrom
dikshaa2909:fix-homepage-url-commit-4748
Open

fix: remove cal-1.0_10.RULE to prevent false positive on C calibration macros#4759
dikshaa2909 wants to merge 1 commit intoaboutcode-org:developfrom
dikshaa2909:fix-homepage-url-commit-4748

Conversation

@dikshaa2909
Copy link

@dikshaa2909 dikshaa2909 commented Feb 18, 2026

Fixes #4740

Problem

cal-1.0_10.RULE matched bare CAL-1.0 which tokenizes to only 3 tokens
(cal, 1, 0). This caused false positive CAL-1.0 license detections
in Linux kernel driver files that contain C calibration macros like:

#define BBDC_CAL  (1 << 0)  /* DC cal BB Start */

Affected files include drivers/iio/adc/ad9361.h, ad6676.h and
frequency/ad9517.c from the Analog Devices Linux tree — all correctly
licensed under GPL-2.0, not CAL-1.0.

Reference: https://github.com/analogdevicesinc/linux/blob/main/drivers/iio/adc/ad9361.h

Fix

Remove cal-1.0_10.RULE since cal-1.0_5.RULE already correctly handles
SPDX-License-Identifier: CAL-1.0 detections. The bare CAL-1.0 pattern
is too short (3 tokens) and ambiguous to reliably detect the license without
causing false positives in hardware/embedded code.

Verification

Before: both gpl-2.0 and cal-1.0 detected in ad9361.h
After: only gpl-2.0 detected

Checklist

  • Reviewed contribution guidelines
  • PR is descriptively titled and links the original issue
  • Tests pass
  • Commits are in uniquely-named feature branch with no merge conflicts
  • Updated documentation pages (not applicable)
  • Updated CHANGELOG.rst (if applicable)

…n macros

The rule matched bare CAL-1.0 (3 tokens: cal, 1, 0) which falsely
detected cal-1.0 license in Linux kernel driver files containing
calibration macros like BBDC_CAL (1 << 0).

cal-1.0_5.RULE already correctly handles SPDX-License-Identifier: CAL-1.0.

Fixes false positive in: drivers/iio/adc/ad9361.h

Signed-off-by: dikshaa2909 <dikshadeware@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some Analog devices iio adc linux drivers being identified with license cal-1.0 incorrectly

1 participant

Comments