public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: quic_kvalo@quicinc.com
Cc: ath12k@lists.infradead.org
Subject: [bug report] wifi: ath12k: return literal zeroes
Date: Thu, 16 Feb 2023 16:59:27 +0300	[thread overview]
Message-ID: <Y+42v5TLeL65Zidp@kili> (raw)

Hello Kalle Valo,

The patch d889913205cf: "wifi: ath12k: driver for Qualcomm Wi-Fi 7
devices" from Nov 28, 2022, leads to the following Smatch static
checker warning:

drivers/net/wireless/ath/ath12k/dp.c:772 ath12k_wbm_idle_ring_setup() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/htc.c:712 ath12k_htc_connect_service() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/mac.c:990 ath12k_mac_monitor_vdev_delete() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/mac.c:4841 ath12k_set_he_mu_sounding_mode() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/core.c:568 ath12k_core_start_firmware() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/dp_rx.c:980 ath12k_dp_rx_peer_tid_setup() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/dp_rx.c:1091 ath12k_dp_rx_ampdu_stop() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/qmi.c:2799 ath12k_qmi_event_server_arrive() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/qmi.c:2813 ath12k_qmi_event_mem_request() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/qmi.c:2960 ath12k_qmi_ops_new_server() info: returning a literal zero is cleaner
drivers/net/wireless/ath/ath12k/qmi.c:3077 ath12k_qmi_init_service() info: returning a literal zero is cleaner

drivers/net/wireless/ath/ath12k/dp.c
    760         *n_link_desc = n_mpdu_link_desc + n_mpdu_queue_desc +
    761                       n_tx_msdu_link_desc + n_rx_msdu_link_desc;
    762 
    763         if (*n_link_desc & (*n_link_desc - 1))
    764                 *n_link_desc = 1 << fls(*n_link_desc);
    765 
    766         ret = ath12k_dp_srng_setup(ab, &dp->wbm_idle_ring,
    767                                    HAL_WBM_IDLE_LINK, 0, 0, *n_link_desc);
    768         if (ret) {
    769                 ath12k_warn(ab, "failed to setup wbm_idle_ring: %d\n", ret);
    770                 return ret;
    771         }
--> 772         return ret;

Better to return 0;

    773 }

The rest are the same but especially this one would be better as a
literal because it's in the middle of a function:

drivers/net/wireless/ath/ath12k/dp_rx.c:980 ath12k_dp_rx_peer_tid_setup() info: returning a literal zero is cleaner

regards,
dan carpenter

-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

                 reply	other threads:[~2023-02-16 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+42v5TLeL65Zidp@kili \
    --to=error27@gmail.com \
    --cc=ath12k@lists.infradead.org \
    --cc=quic_kvalo@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox