Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp446133rwi; Mon, 31 Oct 2022 03:37:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7qTundPeZn8TTU1Zy/LOGKZUYVr7jfFFEKwxbWIg1ExcQYH5qKRqG7xo1r2mHnHJQTyPHe X-Received: by 2002:a17:907:2c71:b0:79e:8603:72c6 with SMTP id ib17-20020a1709072c7100b0079e860372c6mr12490916ejc.172.1667212649135; Mon, 31 Oct 2022 03:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667212649; cv=none; d=google.com; s=arc-20160816; b=oCLCr+rzeF8tn6l9hbq3w5zuH88Gz+DLJ87Y4amJD1l+iseafFW9Lg7utfp9KLHND5 C7hwUBuZlFuhoLfJdRfCmzNeOSTV65YKi0xPNrFIcqC5e7vcHfIox47Kb6ZQOQD63850 TKbpi4UT2rg90+55YJ2Cy/JI0hx60QfLI5Fg9rPJupYxBGeLpwN95L1dVg5trvLYSZQ6 Jf7n7+Q9nktNzJ11v2Oq5jlm3ouLzaBYDZPiRphbee7bPiqoJHHpi/x7hvN6f/SF+wLR oO9vMdPRo6vQ/gr4KbXxSQMVMHiHh+AwtVtAWT7BB9tcL5igUrNoPGqFAzBekWe2ccfv oglA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tIQuGToUvDw0RNfyZgDC8j0kEwL/auecUwzuGJ4/EMc=; b=Y2NcGPX+RRJecwpLLmzFSiOs5h7PN8OohMlrWwboRVrnReGUS5FYb+mqfEWOTgrpm4 HRfwdpPHNhwu8NgoKL6CBxtShn+vxMNQILuReXmhsHEyfeL9VRdSHUWAP8ZN+eAixgT3 hPnBqyM75AATgGIYdo7qbJsIf80iU8rJ1Filishr6o2wcdvQ5fHAWgSlGjioWGH+/pO3 M5ee6XX5ytVxeUCUTivwTxCm/9hCIW6Xcz3CkG0M8+8QH3q4PDmeu9I3oce1TU2FJ9D9 9yfb4MCMFZDWgcKlnVu395wZs6KXqsBaivxYOw94ITixrk6X5s72fTRdc/1iLqZN4/oj e44w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=QCIc4Xbm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020aa7d458000000b00460e691561esi6153199edr.630.2022.10.31.03.37.05; Mon, 31 Oct 2022 03:37:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=QCIc4Xbm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbiJaKHE (ORCPT + 99 others); Mon, 31 Oct 2022 06:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbiJaKHB (ORCPT ); Mon, 31 Oct 2022 06:07:01 -0400 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FAF9DF76; Mon, 31 Oct 2022 03:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1667210786; bh=HVFcKalrqVMRbmdZAkMzLwZC0a2WrrG0XS7qk33EsGE=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=QCIc4XbmZ8KV7vNQ87djZ7QmPWllpqkFXsk8YI+xrr/sfBTIrJ202ch51OMWvTBxL hI37h1K+9uJ7nLPz1whq4WgZksQzyLCv5amOiiOMp1IeSYMPDZZJnN5Qa1QuQ4XSbm Tfqa9fzci/AcUmU55Vetwjp1SCjXdQB4+Cc68RFA= Received: by b-4.in.mailobj.net [192.168.90.14] with ESMTP via [213.182.55.206] Mon, 31 Oct 2022 11:06:26 +0100 (CET) X-EA-Auth: 1a5viqWGMQ4L4O2TH9RfFTgPhO6OEceNDEDbuwFwr9bd6cvaPQrORviVhAVhWL9/eY4g/AIWOHuGtdXjKlYl6p/gFcutTA1d Date: Mon, 31 Oct 2022 15:36:21 +0530 From: Deepak R Varma To: Greg Kroah-Hartman Cc: outreachy@lists.linux.dev, Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , linux-iio@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: iio: ad5933: Use div64_ul instead of do_div Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 29, 2022 at 09:52:40AM +0200, Greg Kroah-Hartman wrote: > On Fri, Oct 28, 2022 at 02:58:49AM +0530, Deepak R Varma wrote: > > do_div() does a 64-by-32 division. Here the divisor is an unsigned long > > which on some platforms is 64 bit wide. So use div64_ul instead of do_div > > to avoid a possible truncation. Issue was identified using the > > coccicheck tool. > > > > Signed-off-by: Deepak R Varma > > --- > > drivers/staging/iio/impedance-analyzer/ad5933.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c > > index f177b20f0f2d..730bb31a20d8 100644 > > --- a/drivers/staging/iio/impedance-analyzer/ad5933.c > > +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c > > @@ -196,7 +196,7 @@ static int ad5933_set_freq(struct ad5933_state *st, > > } dat; > > > > freqreg = (u64)freq * (u64)(1 << 27); > > - do_div(freqreg, st->mclk_hz / 4); > > + freqreg = div64_ul(freqreg, st->mclk_hz / 4); > > > > switch (reg) { > > case AD5933_REG_FREQ_START: > > -- > > 2.34.1 > > No, this isn't ok, please read the mailing list archives for why these > changes are not going to be accepted: > https://lore.kernel.org/r/e2ec77060cc84a33b49d5fd11d7867f6@AcuMS.aculab.com > > Please always at least look at the archives of the past few weeks as to > if changes like this are able to be accepted or not. Hello Greg, My apologies for not looking at the lore mailing archive. I only looked at the past git commits and found a few similar changes accepted in the past. My bad. I will always look at the mailing archive as well going forward. There are other review comments from the experts on similar patches. I appreciate everyone's time and comment. I will look at those and revert accordingly. Thank you, ./drv > > thanks, > > greg k-h