Skip to content

Preserve const qualifiers in string parsing

Alex Hung igt-dev 2 versions – Applied

Status from this message: Applied, thank you all.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 11 repliesApplied
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Split the two v1 patches into five focused patches.
- Include the preceding function context and source location in each warning example, plus OS is Ubuntu 26.04.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5benchmarks/gem_wsim: Preserve const qualifiersbenchmarks/gem_wsim.c+1 -11 reply
2/5tools/intel_reg_spec: Preserve const qualifierstools/intel_reg_spec.c+4 -31 reply
3/5lib: Preserve string const qualifierslib/i915/i915_dp.c lib/igt_core.c lib/igt_drm_fdinfo.c +2 more+12 -111 reply
4/5tests/i915_pm_sseu: Preserve const qualifierstests/intel/i915_pm_sseu.c+4 -41 reply
5/5tests/msm_mapping: Keep parser buffers writabletests/msm/msm_mapping.c+3 -33 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchKamil Konieczny
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH i-g-t v2 0/5] Preserve const qualifiers in string parsing

On Ubuntu 26.04 with glibc 2.43, string searches on const input return const pointers when _GNU_SOURCE is defined. -Wdiscarded-qualifiers warnings for assignments and initializations.

Use const char * for results that are only read. Keep char * where the buffer is modified, and use a separate end pointer for numeric parsing where needed. These changes preserve existing parsing behavior.

The five patches cover benchmarks, tools, libraries, the Intel SSEU test, and the MSM mapping test, in that order. Each commit message includes a warning example with its function and source location.

Changes in v2:
- Split the two v1 patches into five focused patches.
- Include the preceding function context and source location in each warning example, plus OS is Ubuntu 26.04.

The code is unchanged from v1.

Alex Hung (5):
benchmarks/gem_wsim: Preserve const qualifiers
tools/intel_reg_spec: Preserve const qualifiers
lib: Preserve string const qualifiers
tests/i915_pm_sseu: Preserve const qualifiers
tests/msm_mapping: Keep parser buffers writable

 benchmarks/gem_wsim.c      |  2 +-
 lib/i915/i915_dp.c         |  2 +-
 lib/igt_core.c             |  2 +-
 lib/igt_drm_fdinfo.c       |  7 ++++---
 lib/igt_pm.c               | 10 +++++-----
 lib/igt_pm.h               |  2 +-
 tests/intel/i915_pm_sseu.c |  8 ++++----
 tests/msm/msm_mapping.c    |  6 +++---
 tools/intel_reg_spec.c     |  7 ++++---
 9 files changed, 24 insertions(+), 22 deletions(-)
Signature · 1 line
2.53.0