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 E9790C6FA8E for ; Thu, 2 Mar 2023 10:25:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1595310E4A5; Thu, 2 Mar 2023 10:25:34 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id C855510E4B8 for ; Thu, 2 Mar 2023 10:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677752732; x=1709288732; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Zg8zIpePcUTWTG6jLpnoRC8w3cmeMjCx0K5pGe8kfuI=; b=br9ZDR8xmKDxiGAQl8ozLx1cM6+mOvVvqCu7kB3dv7w5om4CaQmirmYM iNZO3v5rMKOkeGNgUSiuDXd1pR6eq8UaHeghk59EotR07xsXmhiyNBNd5 oYGWOM6LqaQ4G8cwL0PoWaowDy2Ihw2yDSaW5tVtxgLYswTjGjOMf30Lr Eq4wG2iHOw3B30YuxQdy1VZGJvWKgmxwmSipohc2DTt7Nae/tjcEVIQgc oXKN/3iwpDRnPedb8nXezjxXN5qKqgkcbKNLZlAYoSD83x5V+3gS9OEFT aXft0vA4C0jAkGUQwZ53tp1xMTKbpdvqBnOuEvMS6u8b6ThQGwQWBKD8h Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="322958706" X-IronPort-AV: E=Sophos;i="5.98,227,1673942400"; d="scan'208";a="322958706" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 02:25:32 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="674910510" X-IronPort-AV: E=Sophos;i="5.98,227,1673942400"; d="scan'208";a="674910510" Received: from joe-255.igk.intel.com (HELO localhost) ([10.91.220.57]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 02:25:31 -0800 Date: Thu, 2 Mar 2023 11:25:29 +0100 From: Stanislaw Gruszka To: Oded Gabbay Subject: Re: [PATCH 2/2] habanalabs: use scnprintf() in print_device_in_use_info() Message-ID: <20230302102529.GC3963532@linux.intel.com> References: <20230302091517.14896-1-ogabbay@kernel.org> <20230302091517.14896-2-ogabbay@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230302091517.14896-2-ogabbay@kernel.org> 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: Tomer Tayar , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Mar 02, 2023 at 11:15:17AM +0200, Oded Gabbay wrote: > From: Tomer Tayar > > compose_device_in_use_info() was added to handle the snprintf() return > value in a single place. > However, the buffer size in print_device_in_use_info() is set such that > it would be enough for the max possible print, so > compose_device_in_use_info() is not really needed. > Moreover, scnprintf() can be used instead of snprintf(), to save the > check if the return value larger than the given size. > > Cc: Stanislaw Gruszka > Signed-off-by: Tomer Tayar > Reviewed-by: Oded Gabbay > Signed-off-by: Oded Gabbay Reviewed-by: Stanislaw Gruszka