[agd5f:drm-next 64/84] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:775:100: warning: suggest braces around empty body in an 'if' statement

From: kernel test robot
Date: Mon Aug 09 2021 - 18:59:42 EST


tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next
head: 234a296b97ec6cee59f2051aaa243192c60ff705
commit: 56aca23093019843e881e458f005569ce9e96c47 [64/84] drm/amd/display: Add AUX I2C tracing.
config: arc-randconfig-r012-20210809 (attached as .config)
compiler: arceb-elf-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f drm-next
git checkout 56aca23093019843e881e458f005569ce9e96c47
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arc

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function 'dce_aux_transfer_with_retries':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:775:100: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
775 | "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER");
| ^
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:783:99: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
783 | "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK");
| ^


vim +/if +775 drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c

682
683 bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
684 struct aux_payload *payload)
685 {
686 int i, ret = 0;
687 uint8_t reply;
688 bool payload_reply = true;
689 enum aux_return_code_type operation_result;
690 bool retry_on_defer = false;
691 struct ddc *ddc_pin = ddc->ddc_pin;
692 struct dce_aux *aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];
693 struct aux_engine_dce110 *aux110 = FROM_AUX_ENGINE(aux_engine);
694 uint32_t defer_time_in_ms = 0;
695
696 int aux_ack_retries = 0,
697 aux_defer_retries = 0,
698 aux_i2c_defer_retries = 0,
699 aux_timeout_retries = 0,
700 aux_invalid_reply_retries = 0;
701
702 if (!payload->reply) {
703 payload_reply = false;
704 payload->reply = &reply;
705 }
706
707 for (i = 0; i < AUX_MAX_RETRIES; i++) {
708 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
709 LOG_FLAG_I2cAux_DceAux,
710 "dce_aux_transfer_with_retries: link_index=%u: START: retry %d of %d: address=0x%04x length=%u write=%d mot=%d",
711 ddc && ddc->link ? ddc->link->link_index : UINT_MAX,
712 i + 1,
713 (int)AUX_MAX_RETRIES,
714 payload->address,
715 payload->length,
716 (unsigned int) payload->write,
717 (unsigned int) payload->mot);
718 if (payload->write)
719 dce_aux_log_payload(" write", payload->data, payload->length, 16);
720 ret = dce_aux_transfer_raw(ddc, payload, &operation_result);
721 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
722 LOG_FLAG_I2cAux_DceAux,
723 "dce_aux_transfer_with_retries: link_index=%u: END: retry %d of %d: address=0x%04x length=%u write=%d mot=%d: ret=%d operation_result=%d payload->reply=%u",
724 ddc && ddc->link ? ddc->link->link_index : UINT_MAX,
725 i + 1,
726 (int)AUX_MAX_RETRIES,
727 payload->address,
728 payload->length,
729 (unsigned int) payload->write,
730 (unsigned int) payload->mot,
731 ret,
732 (int)operation_result,
733 (unsigned int) *payload->reply);
734 if (!payload->write)
735 dce_aux_log_payload(" read", payload->data, ret > 0 ? ret : 0, 16);
736
737 switch (operation_result) {
738 case AUX_RET_SUCCESS:
739 aux_timeout_retries = 0;
740 aux_invalid_reply_retries = 0;
741
742 switch (*payload->reply) {
743 case AUX_TRANSACTION_REPLY_AUX_ACK:
744 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
745 LOG_FLAG_I2cAux_DceAux,
746 "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_AUX_ACK");
747 if (!payload->write && payload->length != ret) {
748 if (++aux_ack_retries >= AUX_MAX_RETRIES) {
749 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_ERROR,
750 LOG_FLAG_Error_I2cAux,
751 "dce_aux_transfer_with_retries: FAILURE: aux_ack_retries=%d >= AUX_MAX_RETRIES=%d",
752 aux_defer_retries,
753 AUX_MAX_RETRIES);
754 goto fail;
755 } else {
756 udelay(300);
757 }
758 } else
759 return true;
760 break;
761
762 case AUX_TRANSACTION_REPLY_AUX_DEFER:
763 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
764 LOG_FLAG_I2cAux_DceAux,
765 "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_AUX_DEFER");
766
767 /* polling_timeout_period is in us */
768 defer_time_in_ms += aux110->polling_timeout_period / 1000;
769 ++aux_defer_retries;
770 fallthrough;
771 case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
772 if (*payload->reply == AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER)
773 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
774 LOG_FLAG_I2cAux_DceAux,
> 775 "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER");

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip