public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael Büsch" <m@bues.ch>
To: Larry Finger <Larry.Finger@lwfinger.net>,
	Rand Deeb <deeb.rand@confident.ru>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	lvc-project@linuxtesting.org,
	voskresenski.stanislav@confident.ru
Subject: Re: [PATCH] ssb-main: Fix division by zero in ssb_calc_clock_rate()
Date: Wed, 30 Aug 2023 22:37:41 +0200	[thread overview]
Message-ID: <20230830223741.7a4684d5@barney> (raw)
In-Reply-To: <4c6d01bf-1a0f-27de-54e1-4afdcf4bc8d5@lwfinger.net>

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

On Wed, 30 Aug 2023 14:50:42 -0500
Larry Finger <Larry.Finger@lwfinger.net> wrote:

> I agree that clkfactor_f6_resolv() could return 0, but we have not
> been overrun with reports of divide by zero errors, which suggests
> that the branch is never taken. This patch will make your tool happy
> and is much simpler:
> 
> diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
> index ab080cf26c9f..b9934b9c2d70 100644
> --- a/drivers/ssb/main.c
> +++ b/drivers/ssb/main.c
> @@ -837,7 +837,7 @@ static u32 clkfactor_f6_resolve(u32 v)
>          case SSB_CHIPCO_CLK_F6_7:
>                  return 7;
>          }
> -       return 0;
> +       return 1;
>   }

Yes, I agree that this is the much simpler and also more sensible
solution to this theoretical problem.

-- 
Michael Büsch
https://bues.ch/

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-08-30 22:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30  8:27 [PATCH] ssb-main: Fix division by zero in ssb_calc_clock_rate() Rand Deeb
2023-08-30 19:50 ` Larry Finger
2023-08-30 20:37   ` Michael Büsch [this message]
2023-08-31  7:07   ` Ранд Дееб
2023-08-31 13:46     ` Krzysztof Kozlowski
2023-08-31 15:35       ` Ранд Дееб
2023-08-31 16:05     ` Michael Büsch
2023-08-31 17:59       ` Larry Finger
2023-08-31 13:47   ` Krzysztof Kozlowski
2023-08-31 13:45 ` Krzysztof Kozlowski
2023-08-31 14:25   ` Ранд Дееб
2023-08-31 14:53     ` Krzysztof Kozlowski

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=20230830223741.7a4684d5@barney \
    --to=m@bues.ch \
    --cc=Larry.Finger@lwfinger.net \
    --cc=deeb.rand@confident.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=voskresenski.stanislav@confident.ru \
    /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