From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE4BDC433EF for ; Mon, 7 Feb 2022 09:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233297AbiBGJcu (ORCPT ); Mon, 7 Feb 2022 04:32:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354778AbiBGJbI (ORCPT ); Mon, 7 Feb 2022 04:31:08 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2E5BC043187 for ; Mon, 7 Feb 2022 01:31:03 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id k1so7029801wrd.8 for ; Mon, 07 Feb 2022 01:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=e71qr5cQmHNfaTvqFdZSatwMnOkMecpoZmeynQAfXfU=; b=IipD0Md8PLGqTRc8YbhUGW9RZUZYMQMHks4wT414D4MJkTvXaIaxCLgX7q7EqqZkkE RniraUcxZGQqnV/BLhI8fR3OhKUqDYUBLkiKkwsuJN/ZNCuhQa9etjVpPPbBQ9jyOrwx MGb+BBECiHqPAOCpL/b5+NFypnEjgPgL0Rb5qKUiTSwuyDcdtYMjQxjnCr4gVMsnv1db 4Li8Ccoityy3n7nCqgyhw562KdbA+9+AlCO3h6k33jebIUk0d7GU1cLOM5H73yN+w4Xf YMhAHQA5StGpYsrAUVc3HUB89o5DXP0IdN5Syh15D5UZS0wH6QYVpbsbWtyqGxNwNZ4L OgFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=e71qr5cQmHNfaTvqFdZSatwMnOkMecpoZmeynQAfXfU=; b=PKZXO8gmthx6WjnpoKX3UJuUAel1WJkqO+LxyGew0dzLjQUu+zAFzQylv0zPadKvIc xUh5oJClqkhL8V+BWOZ/LUc/iWSbn+nxEj9926qxZXyhA0JlZXQpvGuYjt/Q7m7IFj1D PGPglc2scDQO4nvcFPAGPzd3FK6ztMwOHMqWatD2cdDavAzHD79wT1FQ6r22NWRLfnkh vPrcTqQBnICX6E63k77aXcvPoA5RN2IHH5Xv3mXwafPk2bfqzCh7mn8KXbPIY84K+yFM kQ5+AMEGpRma1vfFTk1elD0mx4sHDV1L9eHn3eptLfeFJCTAnKBZj/ET8rhSVky0f04I DQLw== X-Gm-Message-State: AOAM532s7eBLMIngKzWyzJEdN1xu1dHizlsjAEpgPj+ccDumV1+mTMks +UzDtBWWeDddCBQaM9G4A50jnw== X-Google-Smtp-Source: ABdhPJxyfEhDPaQTrpIwF3s8f+P5EuB6O3syjtuhYC4gv/uXtG6GnEb8OsVA43hN5ymF4KDaQpvKuQ== X-Received: by 2002:a05:6000:385:: with SMTP id u5mr3350003wrf.105.1644226262555; Mon, 07 Feb 2022 01:31:02 -0800 (PST) Received: from google.com (cpc155339-bagu17-2-0-cust87.1-3.cable.virginm.net. [86.27.177.88]) by smtp.gmail.com with ESMTPSA id n15sm10497806wrf.37.2022.02.07.01.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 01:31:01 -0800 (PST) Date: Mon, 7 Feb 2022 09:31:00 +0000 From: Lee Jones To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Christophe JAILLET , Thierry Reding , Daniel Thompson , Jingoo Han , Helge Deller , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation Message-ID: References: <20220207080128.xmvommcddjfgz7ey@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220207080128.xmvommcddjfgz7ey@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: kernel-janitors@vger.kernel.org On Mon, 07 Feb 2022, Uwe Kleine-König wrote: > On Sat, Feb 05, 2022 at 08:40:48AM +0100, Christophe JAILLET wrote: > > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > > a multiplication is needed to compute the size of the requested memory. > > > > So turn a kzalloc()+explicit size computation into an equivalent kcalloc(). > > > > Signed-off-by: Christophe JAILLET > > LGTM > > Acked-by: Christophe JAILLET > > Thanks > Uwe I am totally confused! -- Lee Jones [李琼斯] Principal Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 619D8C433F5 for ; Mon, 7 Feb 2022 09:31:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5823310EDF9; Mon, 7 Feb 2022 09:31:05 +0000 (UTC) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id 135F510EDF9 for ; Mon, 7 Feb 2022 09:31:04 +0000 (UTC) Received: by mail-wr1-x432.google.com with SMTP id s10so20972601wra.5 for ; Mon, 07 Feb 2022 01:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=e71qr5cQmHNfaTvqFdZSatwMnOkMecpoZmeynQAfXfU=; b=IipD0Md8PLGqTRc8YbhUGW9RZUZYMQMHks4wT414D4MJkTvXaIaxCLgX7q7EqqZkkE RniraUcxZGQqnV/BLhI8fR3OhKUqDYUBLkiKkwsuJN/ZNCuhQa9etjVpPPbBQ9jyOrwx MGb+BBECiHqPAOCpL/b5+NFypnEjgPgL0Rb5qKUiTSwuyDcdtYMjQxjnCr4gVMsnv1db 4Li8Ccoityy3n7nCqgyhw562KdbA+9+AlCO3h6k33jebIUk0d7GU1cLOM5H73yN+w4Xf YMhAHQA5StGpYsrAUVc3HUB89o5DXP0IdN5Syh15D5UZS0wH6QYVpbsbWtyqGxNwNZ4L OgFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=e71qr5cQmHNfaTvqFdZSatwMnOkMecpoZmeynQAfXfU=; b=PBRb3NbKDjX02Iu9OkxXmso0Q+EOxHs5Xww5UGMN0HR9R+xk1nN+5sRhaw5pjTKI4M OLts9fWRRPsjFVwKFJxMMzFT1BEu9coa7knAjsYi1tSxnIRFtkCM8QatvudbO6c1IrZb EvS4J2ILjNw70btgvAULAWbFe640lqzP1Dz2uNtGhK715SGc7Wt7sy7SMlUkFTUlTCjs lYI9c3mBQiznC+tOtORbof9KurvAn402xP49dGvAuo0S5Ir9L5el0JaOSECS7ZPFtM4i II8dLF8G94Oomf+HbVdR+jDtD8L9qNW5SeuFXU7SlUlyqDRxiTf+3vPiM7Yz8M4i0qZn gzWA== X-Gm-Message-State: AOAM532sRHdtuxPnByCJnSAc+NMVq4fmRl3GjYJR17cx2gcmLottiz1z d7oQuFcSSsCyiU4KO0m8kIiqpw== X-Google-Smtp-Source: ABdhPJxyfEhDPaQTrpIwF3s8f+P5EuB6O3syjtuhYC4gv/uXtG6GnEb8OsVA43hN5ymF4KDaQpvKuQ== X-Received: by 2002:a05:6000:385:: with SMTP id u5mr3350003wrf.105.1644226262555; Mon, 07 Feb 2022 01:31:02 -0800 (PST) Received: from google.com (cpc155339-bagu17-2-0-cust87.1-3.cable.virginm.net. [86.27.177.88]) by smtp.gmail.com with ESMTPSA id n15sm10497806wrf.37.2022.02.07.01.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 01:31:01 -0800 (PST) Date: Mon, 7 Feb 2022 09:31:00 +0000 From: Lee Jones To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation Message-ID: References: <20220207080128.xmvommcddjfgz7ey@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220207080128.xmvommcddjfgz7ey@pengutronix.de> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, Daniel Thompson , Jingoo Han , Helge Deller , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thierry Reding , Christophe JAILLET , linux-fbdev@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, 07 Feb 2022, Uwe Kleine-König wrote: > On Sat, Feb 05, 2022 at 08:40:48AM +0100, Christophe JAILLET wrote: > > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > > a multiplication is needed to compute the size of the requested memory. > > > > So turn a kzalloc()+explicit size computation into an equivalent kcalloc(). > > > > Signed-off-by: Christophe JAILLET > > LGTM > > Acked-by: Christophe JAILLET > > Thanks > Uwe I am totally confused! -- Lee Jones [李琼斯] Principal Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog