[bug report] drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Lina Iyer,

The patch 48dbb0f02d34: "drivers: qcom: rpmh-rsc: allow invalidation
of sleep/wake TCS" from Jun 20, 2018, leads to the following static
checker warning:

	drivers/soc/qcom/rpmh-rsc.c:111 tcs_invalidate()
	warn: 'tcs' isn't an ERR_PTR

drivers/soc/qcom/rpmh-rsc.c
   100  static struct tcs_group *get_tcs_of_type(struct rsc_drv *drv, int type)
   101  {
   102          return &drv->tcs[type];
   103  }
   104  
   105  static int tcs_invalidate(struct rsc_drv *drv, int type)
   106  {
   107          int m;
   108          struct tcs_group *tcs;
   109  
   110          tcs = get_tcs_of_type(drv, type);
   111          if (IS_ERR(tcs))
   112                  return PTR_ERR(tcs);

get_tcs_of_type() always returns valid pointers.  Maybe just remove the
condition?

   113  
   114          spin_lock(&tcs->lock);
   115          if (bitmap_empty(tcs->slots, MAX_TCS_SLOTS)) {
   116                  spin_unlock(&tcs->lock);
   117                  return 0;
   118          }
   119  
   120          for (m = tcs->offset; m < tcs->offset + tcs->num_tcs; m++) {
   121                  if (!tcs_is_free(drv, m)) {
   122                          spin_unlock(&tcs->lock);
   123                          return -EAGAIN;
   124                  }
   125                  write_tcs_reg_sync(drv, RSC_DRV_CMD_ENABLE, m, 0);
   126          }
   127          bitmap_zero(tcs->slots, MAX_TCS_SLOTS);
   128          spin_unlock(&tcs->lock);
   129  
   130          return 0;
   131  }

See also:
drivers/soc/qcom/rpmh-rsc.c:178 get_tcs_for_msg() warn: 'tcs' isn't an ERR_PTR
drivers/soc/qcom/rpmh-rsc.c:180 get_tcs_for_msg() warn: 'tcs' isn't an ERR_PTR

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux