On 7/6/2023 6:59 PM, Stephen Hemminger wrote: > Based off patch generated by cocci/mtod-offset.cocci. > With some cleanup to shorten lines by using conditional > with omitted operand. > > Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
<...> > @@ -5163,9 +5169,9 @@ test_snow3g_auth_cipher(const struct snow3g_test_data > *tdata, > debug_hexdump(stdout, "ciphertext expected:", > tdata->ciphertext.data, tdata->ciphertext.len >> 3); > > - ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) > - + (tdata->digest.offset_bytes == 0 ? > - plaintext_pad_len : tdata->digest.offset_bytes); > + ut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf, > + uint8_t *, > + tdata->digest.offset_bytes ? : > plaintext_pad_len); > As far as I know "x ?: y" support is gcc extention, what about sticking to standard syntax?