Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7309097rwd; Mon, 19 Jun 2023 22:37:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iZtCnOqGXdSOHToVfK+xtt3JioWGlPsT+vcJMeF0YY2qtXhdY60L6wyU1iX0h1iDWSNIT X-Received: by 2002:a05:6830:113:b0:6b1:6b28:4a00 with SMTP id i19-20020a056830011300b006b16b284a00mr7689602otp.14.1687239431895; Mon, 19 Jun 2023 22:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687239431; cv=none; d=google.com; s=arc-20160816; b=RZuka1XxGCxYV+9/W0MNdEx2KsQMa07uWepm71YtP+T1s043a9K97ghT49tnIfr8d6 0zUSXs4U/Me1ETwsNEGYhC10PAnC37Uo8sgbTmW8Ih01avgd0joC+ZMDlo4+iIEusPD7 65ZwC/Ot0VUQk9/IoY+g5tQGDDbh7FcWXJu9j8f8eDVoMKthCdxE6iV1VH3qi0mdtEex 5Jw1inI5ghnWyhZEVm9cnRW/MgJFfoCYOmBcte0RFGTRlt25D18ssSw4hRwjHcn62W39 BmqI6W/KbGzjDf+QZ/nPp29bNr5z5/UMq4Wn8YbwCoEYjn/xPUx/GCOLX8D2zkwLqqLu BgCA== 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=y7PuqpyqHE/HUVu8CRaW9WlThpzPBfO6+875ZQx+jnA=; b=gG1LMd/dtF5VdkxgkCLAzGoPRuLB+hhcVnHIzdZkZY7yX5ogjiYbpUcetXcGz57NGy HwKIZ8gIM6JZMzyVz8e/eFVkUaq3zrpiyXy7PknRc89uJXig9vz9LOyjlzjM+PcYBNe5 AD7g3p/Uo0qUUU3VJ1sXX40YaWVwg1vy1mLw5noyK3Aqf60cYAoceq6po71O3yJ+LTlV EervZvwI8an9KtgxJrFRmyz41Vq4/YD2ZaZ0rq3cLPmxKvRSzmzMq+EM1HrnGlc9hLyV wMQPJrqFQgG2fO0XNkH4pMXnrYEO5to+9LJS3conTPuSUMvxEMwmr3Qb/tJpC+rIMJkP 3KbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=euZ3NbqF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a637547000000b005533e742f9dsi990046pgn.470.2023.06.19.22.36.56; Mon, 19 Jun 2023 22:37:11 -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=pass header.i=@linaro.org header.s=google header.b=euZ3NbqF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbjFTFSN (ORCPT + 99 others); Tue, 20 Jun 2023 01:18:13 -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-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> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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