[bug report] staging: mt7621-mmc: MIPS: ralink: add sdhci for mt7620a SoC

Dan Carpenter dan.carpenter at oracle.com
Thu Apr 5 04:56:54 PDT 2018


Hello John Crispin,

The patch 8b634a9c7620: "staging: mt7621-mmc: MIPS: ralink: add sdhci
for mt7620a SoC" from Mar 15, 2018, leads to the following static
checker warning:

	drivers/staging/mt7621-mmc/sd.c:2790 msdc_drv_probe()
	warn: curly braces intended?

drivers/staging/mt7621-mmc/sd.c
  2777      /* For sd card: MSDC_SYS_SUSPEND | MSDC_WP_PIN_EN | MSDC_CD_PIN_EN | MSDC_REMOVABLE | MSDC_HIGHSPEED, 
  2778         For sdio   : MSDC_EXT_SDIO_IRQ | MSDC_HIGHSPEED */
  2779      if (hw->flags & MSDC_HIGHSPEED) {
  2780          mmc->caps   = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
  2781      }
  2782      if (hw->data_pins == 4) { /* current data_pins are all 4*/
  2783          mmc->caps  |= MMC_CAP_4_BIT_DATA;
  2784      } else if (hw->data_pins == 8) {
  2785          mmc->caps  |= MMC_CAP_8_BIT_DATA;
  2786      }
  2787      if ((hw->flags & MSDC_SDIO_IRQ) || (hw->flags & MSDC_EXT_SDIO_IRQ))

Are curly braces intended for this if statement?

  2788          mmc->caps |= MMC_CAP_SDIO_IRQ;  /* yes for sdio */
  2789  
  2790          cd_active_low = !of_property_read_bool(pdev->dev.of_node, "mediatek,cd-high");
  2791          mtk_sw_poll = of_property_read_bool(pdev->dev.of_node, "mediatek,cd-poll");
  2792  
  2793          if (mtk_sw_poll)
  2794                  mmc->caps |= MMC_CAP_NEEDS_POLL;

because the indenting seems to say that the braces should reach up to
here.

  2795  
  2796      /* MMC core transfer sizes tunable parameters */
  2797  #if LINUX_VERSION_CODE > KERNEL_VERSION(3,10,0)
  2798      mmc->max_segs      = MAX_HW_SGMTS;
  2799  #else
  2800      mmc->max_hw_segs   = MAX_HW_SGMTS;
  2801      mmc->max_phys_segs = MAX_PHY_SGMTS;
  2802  #endif


regards,
dan carpenter



More information about the Linux-mediatek mailing list