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 5A01BC433FE for ; Tue, 25 Jan 2022 03:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1319447AbiAYDIx (ORCPT ); Mon, 24 Jan 2022 22:08:53 -0500 Received: from mga04.intel.com ([192.55.52.120]:35769 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S3411286AbiAYCSx (ORCPT ); Mon, 24 Jan 2022 21:18:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643077133; x=1674613133; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=KAXXV2h5IEh2o2heBK5sVGCZvPMYLdPslBngGuuOVBA=; b=ZIWz8CN7CRMFseHfZJh3+yQJlAIcs9fhXGCdoPrN5lMslp3VYPaRQ7MR UCB7gDlCvzOu8wq2sj3V/Lk8b1duXqd4Z/66vd72QqSLcgAC8u5hQw3K6 YuowgbPpKuWH+r4qF3yQoqCT7k63TRjGiyeBc2XE2Jhm4JStC+BuVdxCW LrDKsoj8AZMa+4gz+eenqrIEGc60DHcIbvI4hJPBO/jzywNpgUq7vcuWM Gv/59vMQq9PGNkDba7A2f4YGLm8uPe9OsmTZvjcpX3AjCuGxy6y+UfaY4 2whiHNFp+CXfZDyqckCHIFrooJrDWwTXAgkGLcOO2qJ3N7+gP6+dpuFDn Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="245024170" X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="245024170" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 17:14:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="520174651" Received: from lkp-server01.sh.intel.com (HELO 276f1b88eecb) ([10.239.97.150]) by orsmga007.jf.intel.com with ESMTP; 24 Jan 2022 17:14:17 -0800 Received: from kbuild by 276f1b88eecb with local (Exim 4.92) (envelope-from ) id 1nCAPY-000J9c-Ki; Tue, 25 Jan 2022 01:14:16 +0000 Date: Tue, 25 Jan 2022 09:13:28 +0800 From: kernel test robot To: Hao Lee Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, 0day robot , Alexey Dobriyan Subject: [PATCH] proc: fix alloc_cast.cocci warnings Message-ID: <20220125011328.GA21479@a311be8fcee1> References: <202201250941.1xbLnDRA-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202201250941.1xbLnDRA-lkp@intel.com> X-Patchwork-Hint: ignore User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kernel test robot fs/proc/base.c:1767:14-18: WARNING: casting value returned by memory allocation function to (char *) is useless. Remove casting the values returned by memory allocation functions like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc. Semantic patch information: This makes an effort to find cases of casting of values returned by kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc, kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes the casting as it is not required. The result in the patch case may need some reformatting. Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci CC: Hao Lee Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://github.com/0day-ci/linux/commits/UPDATE-20220123-215907/Hao-Lee/proc-use-kmalloc-instead-of-__get_free_page-to-alloc-path-buffer/20220123-181005 head: 98106e76de95ae9aefa914ec056448a5571155dc commit: 98106e76de95ae9aefa914ec056448a5571155dc proc: alloc PATH_MAX bytes for /proc/${pid}/fd/ symlinks :::::: branch date: 35 hours ago :::::: commit date: 35 hours ago base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1764,7 +1764,7 @@ out: static int do_proc_readlink(struct path *path, char __user *buffer, int buflen) { - char *tmp = (char *)kmalloc(PATH_MAX, GFP_KERNEL); + char *tmp = kmalloc(PATH_MAX, GFP_KERNEL); char *pathname; int len;