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 452FFEB64D7 for ; Tue, 20 Jun 2023 05:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230359AbjFTFSP (ORCPT ); Tue, 20 Jun 2023 01:18:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjFTFSM (ORCPT ); Tue, 20 Jun 2023 01:18:12 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2ABB10D5 for ; Mon, 19 Jun 2023 22:18:10 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b45c289615so53892101fa.1 for ; Mon, 19 Jun 2023 22:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687238288; x=1689830288; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=y7PuqpyqHE/HUVu8CRaW9WlThpzPBfO6+875ZQx+jnA=; b=euZ3NbqF9mB24d0ScudIoCLcjGflfbklhPemkj/vHLxufMsWRiAGBP9qLHpeL7+ibl KRmAsBeL396AbnFIajAYSoVRQP1OSDV73iXpEuEqKjWbJuW1jnhGCNpaD4i0QrN0y4SC YYqtSkae846yMDjV3BaQJTSXpLLQqClqPJQylp5sQ9hbnOQKXk86ODhLiNMZFzXOUmqw spw6fYU/7QuiB7LtKQuSToUkUX4PVOZ7HQi9Sg3oPqRwUMlyvKkWTohnsVrmuBqhDdjp MORXtKz1IOxy2hQ2xYKKGz6TA5JWo/svqiWxln2fXV1LiYLgXbWOUwRQFaBoRWj+xMHI ESxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687238288; x=1689830288; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=y7PuqpyqHE/HUVu8CRaW9WlThpzPBfO6+875ZQx+jnA=; b=BTIh4Qa8Lf48uUUTrVCTmsBihp7SSTw5CO5DH7dOZvcALvPpLSPidIgyRBIwf/KTLQ Zzjat/SWnTWJl2sA5Z1PKzmdiYCppA0v1y/zz9YKHtY8RE6av3lICa7PQUo8PYfQ9QVW t3HLS/Wa7NyqUivuJLHapSut0YGjDVliVuOHTkSGXeUDV/wGEHwrOGDMY8wzI6QVJxu4 9Nzeh89mOb2zr8KupLuZPGm1iFwg8FO6Vm+tSceSsVc0TX1UKvNLszh4EwRqMHtFVnGM h67FiWUHDzCvOq4UCf8/9Uhrtr5Cwr3mgeuDSczuXPmmM2Ah/QW3A+DLDkGRQjgiQTgE txjw== X-Gm-Message-State: AC+VfDxFKRs9v8Z7hWeW3xx1UhxoP/IqCoYGUZqf8ya+Q7w8HHeROmTe aGOF4JrRpX0+LlhuIpOiaUZXC+jm0R6HrvfZOwU= X-Google-Smtp-Source: ACHHUZ5ccBcWPxcFeRk9KZTmk2iY37jAco/koAiv37L1FuAnmeROZMwkEffaczENJYwJooQ+gl1ReA== X-Received: by 2002:a2e:95c4:0:b0:2b4:6a20:f12d with SMTP id y4-20020a2e95c4000000b002b46a20f12dmr4718664ljh.43.1687238288311; Mon, 19 Jun 2023 22:18:08 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id z8-20020a05600c220800b003f9b12b1598sm4395724wml.22.2023.06.19.22.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 22:18:05 -0700 (PDT) Date: Tue, 20 Jun 2023 08:18:02 +0300 From: Dan Carpenter To: Prathu Baronia Cc: Greg Kroah-Hartman , "Fabio M. De Francesco" , Khadija Kamran , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, error27@gmail.com, lkp@intel.com, oe-kbuild-all@lists.linux.dev, oe-kbuild@lists.linux.dev Subject: Re: [PATCH v6 1/2] axis-fifo: use devm_kasprintf() for allocating formatted strings Message-ID: References: <20230619162246.33007-1-prathubaronia2011@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230619162246.33007-1-prathubaronia2011@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 19, 2023 at 09:52:44PM +0530, Prathu Baronia wrote: > In various places, string buffers of a fixed size are allocated, and > filled using snprintf() with the same fixed size, which is error-prone. > > Replace this by calling devm_kasprintf() instead, which always uses the > appropriate size. > > Signed-off-by: Prathu Baronia > --- > V5 -> V6: Split into api change and name change commits > V4 -> V5: Remove the dev_info() and use a unique identifier for dev name > V3 -> V4: Split into warning fixing and cleanup commits > V2 -> V3: Fix smatch warnings from kernel test robot > V1 -> V2: Split into logical commits and fix commit message > > - snprintf(device_name, 32, "%s_%pa", DRIVER_NAME, &r_mem->start); ^^^ > + device_name = devm_kasprintf(dev, GFP_KERNEL, "%s_%p", DRIVER_NAME, &r_mem->start); ^^ This is a sneaky fix which Greg already kind of complained about if I remember correctly... regards, dan carpenter