All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-iio@vger.kernel.org
Subject: [Bug 221442] New: Compile time assert error on iio/opt4001: FIELD_PREP: value too large for the field
Date: Thu, 30 Apr 2026 16:55:17 +0000	[thread overview]
Message-ID: <bug-221442-217253@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=221442

            Bug ID: 221442
           Summary: Compile time assert error on iio/opt4001: FIELD_PREP:
                    value too large for the field
           Product: Drivers
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: IIO
          Assignee: drivers_iio@kernel-bugs.kernel.org
          Reporter: lito.15@proton.me
        Regression: No

When compiling one of the drivers (config was gotten with `zcat
/proc/config.gz` on Arch Linux), compilation fails with an assert:

```
drivers/iio/light/opt4001.c:215:9: error: call to '__compiletime_assert_528'
declared with 'error'
      attribute: FIELD_PREP: value too large for the field
  215 |         reg |= FIELD_PREP(OPT4001_CTRL_CONV_TIME_MASK, chip->int_time);
      |                ^
./include/linux/bitfield.h:138:3: note: expanded from macro 'FIELD_PREP'
  138 |                 __FIELD_PREP(_mask, _val, "FIELD_PREP: ");             
\
      |                 ^
./include/linux/bitfield.h:91:3: note: expanded from macro '__FIELD_PREP'
   91 |                 __BF_FIELD_CHECK_MASK(mask, val, pfx);                 
\
      |                 ^
./include/linux/bitfield.h:70:3: note: expanded from macro
'__BF_FIELD_CHECK_MASK'
   70 |                 BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?          
\
      |                 ^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see
all)
././include/linux/compiler_types.h:694:2: note: expanded from macro
'_compiletime_assert'
  694 |         __compiletime_assert(condition, msg, prefix, suffix)
      |         ^
././include/linux/compiler_types.h:687:4: note: expanded from macro
'__compiletime_assert'
  687 |                         prefix ## suffix();                            
\
      |                         ^
<scratch space>:18:1: note: expanded from here
   18 | __compiletime_assert_528
      | ^
1 error generated.
make[5]: *** [scripts/Makefile.build:289: drivers/iio/light/opt4001.o] Error 1
make[4]: *** [scripts/Makefile.build:548: drivers/iio/light] Error 2
make[3]: *** [scripts/Makefile.build:548: drivers/iio] Error 2
make[2]: *** [scripts/Makefile.build:548: drivers] Error 2
make[1]: *** [/home/lito/linux-7.0.2/Makefile:2103: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
exit 2
```

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

                 reply	other threads:[~2026-04-30 16:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-221442-217253@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.