Linux wireless drivers development
 help / color / mirror / Atom feed
* [bug report] qtnfmac: introduce new FullMAC driver for Quantenna chipsets
@ 2017-06-19 10:55 Dan Carpenter
  2017-06-19 21:35 ` Igor Mitsyanko
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-06-19 10:55 UTC (permalink / raw)
  To: igor.mitsyanko.os; +Cc: linux-wireless

Hello Igor Mitsyanko,

The patch 98f44cb0655c: "qtnfmac: introduce new FullMAC driver for
Quantenna chipsets" from May 11, 2017, leads to the following static
checker warning:

	drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c:285 qtnf_pcie_init_dma_mask()
	info: return a literal instead of 'ret'

drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
   277  static int
   278  qtnf_pcie_init_dma_mask(struct qtnf_pcie_bus_priv *priv, u64 dma_mask)
   279  {
   280          int ret;
   281  
   282          ret = dma_supported(&priv->pdev->dev, dma_mask);
   283          if (!ret) {
   284                  pr_err("DMA mask %llu not supported\n", dma_mask);
   285                  return ret;

We should probably return a negative?  It's also possible that returning
zero is intended but then we should use a literal so it's more clearly
deliberate.

   286          }
   287  
   288          ret = pci_set_dma_mask(priv->pdev, dma_mask);
   289          if (ret) {
   290                  pr_err("failed to set DMA mask %llu\n", dma_mask);
   291                  return ret;
   292          }
   293  
   294          ret = pci_set_consistent_dma_mask(priv->pdev, dma_mask);
   295          if (ret) {
   296                  pr_err("failed to set consistent DMA mask %llu\n", dma_mask);
   297                  return ret;
   298          }
   299  
   300          return ret;
   301  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] qtnfmac: introduce new FullMAC driver for Quantenna chipsets
  2017-06-19 10:55 [bug report] qtnfmac: introduce new FullMAC driver for Quantenna chipsets Dan Carpenter
@ 2017-06-19 21:35 ` Igor Mitsyanko
  0 siblings, 0 replies; 2+ messages in thread
From: Igor Mitsyanko @ 2017-06-19 21:35 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-wireless

On 06/19/2017 03:55 AM, Dan Carpenter wrote:
> 
> External Email
> 
> 
> Hello Igor Mitsyanko,
> 
> The patch 98f44cb0655c: "qtnfmac: introduce new FullMAC driver for
> Quantenna chipsets" from May 11, 2017, leads to the following static
> checker warning:
> 
>          drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c:285 qtnf_pcie_init_dma_mask()
>          info: return a literal instead of 'ret'
> 
> drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
>     277  static int
>     278  qtnf_pcie_init_dma_mask(struct qtnf_pcie_bus_priv *priv, u64 dma_mask)
>     279  {
>     280          int ret;
>     281
>     282          ret = dma_supported(&priv->pdev->dev, dma_mask);
>     283          if (!ret) {
>     284                  pr_err("DMA mask %llu not supported\n", dma_mask);
>     285                  return ret;
> 
> We should probably return a negative?  It's also possible that returning
> zero is intended but then we should use a literal so it's more clearly
> deliberate.

Hello Dan,
it is indeed a bug, 0 is not expected in case of error. Will fix, thanks!

> 
>     286          }
>     287
>     288          ret = pci_set_dma_mask(priv->pdev, dma_mask);
>     289          if (ret) {
>     290                  pr_err("failed to set DMA mask %llu\n", dma_mask);
>     291                  return ret;
>     292          }
>     293
>     294          ret = pci_set_consistent_dma_mask(priv->pdev, dma_mask);
>     295          if (ret) {
>     296                  pr_err("failed to set consistent DMA mask %llu\n", dma_mask);
>     297                  return ret;
>     298          }
>     299
>     300          return ret;
>     301  }
> 
> regards,
> dan carpenter
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-19 21:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-19 10:55 [bug report] qtnfmac: introduce new FullMAC driver for Quantenna chipsets Dan Carpenter
2017-06-19 21:35 ` Igor Mitsyanko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox