HomeFreeBSD

icp: add no_const for PaX Compat

Description

icp: add no_const for PaX Compat

The constify plugin will automatically constify a class of types that contain
only function pointers. The icp structs fail to build if this is enabled with
the following error. The no_const attribute makes the plugin skip those
structs.

module/icp/spi/kcf_spi.c: In function ‘copy_ops_vector_v1’:
module/icp/spi/kcf_spi.c:61:16: error: assignment of read-only location ‘*dst_ops->cou.cou_v1.co_control_ops’

*((dst)->ops) = *((src)->ops);
              ^

module/icp/spi/kcf_spi.c:74:2: note: in expansion of macro ‘KCF_SPI_COPY_OPS’

KCF_SPI_COPY_OPS(src_ops, dst_ops, co_control_ops);
^

Signed-off-by: Jason Zaman <jason@perfinion.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4947
Closes #4962

Details

Provenance
Jason Zaman <jason@perfinion.com>Authored on Aug 9 2016, 4:56 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 12 2016, 4:51 PM
Parents
rG6eb73b00466b: Reorder HAVE_BIO_RW_* checks
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGa9947ce77175: icp: add no_const for PaX Compat (authored by Jason Zaman <jason@perfinion.com>).Aug 12 2016, 4:51 PM