From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B535519BCA for ; Fri, 15 Mar 2024 16:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710520582; cv=none; b=Qf13TR3IxirAflPth78ADAHNlOV5MycPqvEYHnHooowA0ECT2D5kFfaSMD+cYnlmQySVEBvsneXI9l5OwYUJ5oOdAxZZSeMICXYsXK9y+BPdXQLoJhcI8DsIrMx+sBfli55CX7oR8xMWXvdTusR4+f3NUvLbwuIK+w1UORoAkfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710520582; c=relaxed/simple; bh=Q8r9LaIN/IKCw/TpmesZAnPpU8DRX3TMD/FIBkJ3ij0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Ag6DfTrYcaiIWeR0MBfBWYO46X6K1HABZNcRgeA0ri4AYXm8iGXtIRK+2D6kG4kdgLa3DvsFsyLzUkNKDQop1kdCznIIpXVmcABUrHqofXs7CcKX7uIrP6Kf6oQjuhr6Cd+QzV09FCTb3MX8UEkPYQOAGaPYIwD59NKMwfq7+4o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ei/K/Nd9; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ei/K/Nd9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710520581; x=1742056581; h=date:from:to:cc:subject:message-id:mime-version; bh=Q8r9LaIN/IKCw/TpmesZAnPpU8DRX3TMD/FIBkJ3ij0=; b=ei/K/Nd9tryf8Ge17Am+xurZefMuKlswIRHEmmJy+mYLLsQ8jD9oqNpg gt6daEXrO33Zk6bd+SZDz8sJOoEqbI9DyOTNcLO6u8OPSoD/sauPtbbxh 3GmQTUyQAnTZOz7zcJUCs/aKqwqm5llTy9d5vG2/CvQjkh2/1UjK423wA 5xtQ1XoLtrsVyEWG6CVFwk1BdXtsL0f8kUB0y+l0tRJrlm6o5uc8WUW/d 8I/9TcP/QdLeOWVcfwb/SMN80xF1JY5jkK6ZhbyJM2hXZ50/RwVBtR3Sl jZVLqNOnqzVUREHE0wNNuuzBoDsFeXyb8nkknGjfTNKpgfVn8ciGUneBl w==; X-IronPort-AV: E=McAfee;i="6600,9927,11014"; a="6002046" X-IronPort-AV: E=Sophos;i="6.07,128,1708416000"; d="scan'208";a="6002046" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2024 09:36:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,128,1708416000"; d="scan'208";a="12643370" Received: from lkp-server01.sh.intel.com (HELO b21307750695) ([10.239.97.150]) by fmviesa007.fm.intel.com with ESMTP; 15 Mar 2024 09:36:16 -0700 Received: from kbuild by b21307750695 with local (Exim 4.96) (envelope-from ) id 1rlAXW-000Ecl-0p; Fri, 15 Mar 2024 16:36:14 +0000 Date: Sat, 16 Mar 2024 00:36:04 +0800 From: kernel test robot To: kernel@openeuler.org, fanyizhen1995 Cc: oe-kbuild-all@lists.linux.dev Subject: [openeuler:OLK-5.10 24783/30000] drivers/ub/urma/uburma/uburma_dev_ops.c:32:6: warning: no previous prototype for 'uburma_release_file' Message-ID: <202403160056.fe8TqdpG-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 32bb7b0a7c87769858fbb9d60574b830383c28f7 commit: cd637a6dded9c0dce5f8d79898bb25be2edb927a [24783/30000] ub: uburma support open/release file ops config: arm64-randconfig-003-20240312 (https://download.01.org/0day-ci/archive/20240316/202403160056.fe8TqdpG-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240316/202403160056.fe8TqdpG-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202403160056.fe8TqdpG-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/ub/urma/uburma/uburma_dev_ops.c:32:6: warning: no previous prototype for 'uburma_release_file' [-Wmissing-prototypes] 32 | void uburma_release_file(struct kref *ref) | ^~~~~~~~~~~~~~~~~~~ >> drivers/ub/urma/uburma/uburma_dev_ops.c:49:5: warning: no previous prototype for 'uburma_open' [-Wmissing-prototypes] 49 | int uburma_open(struct inode *inode, struct file *filp) | ^~~~~~~~~~~ drivers/ub/urma/uburma/uburma_dev_ops.c: In function 'uburma_open': >> drivers/ub/urma/uburma/uburma_dev_ops.c:66:50: warning: the comparison will always evaluate as 'false' for the address of 'dev_name' will never be NULL [-Waddress] 66 | if (ubc_dev == NULL || ubc_dev->dev_name == NULL) { | ^~ In file included from drivers/ub/urma/uburma/uburma_dev_ops.c:25: include/urma/ubcore_types.h:1589:14: note: 'dev_name' declared here 1589 | char dev_name[UBCORE_MAX_DEV_NAME]; | ^~~~~~~~ drivers/ub/urma/uburma/uburma_dev_ops.c: At top level: >> drivers/ub/urma/uburma/uburma_dev_ops.c:102:5: warning: no previous prototype for 'uburma_close' [-Wmissing-prototypes] 102 | int uburma_close(struct inode *inode, struct file *filp) | ^~~~~~~~~~~~ vim +/uburma_release_file +32 drivers/ub/urma/uburma/uburma_dev_ops.c 31 > 32 void uburma_release_file(struct kref *ref) 33 { 34 struct uburma_file *file = container_of(ref, struct uburma_file, ref); 35 int srcu_idx; 36 37 srcu_idx = srcu_read_lock(&file->ubu_dev->ubc_dev_srcu); 38 srcu_dereference(file->ubu_dev->ubc_dev, &file->ubu_dev->ubc_dev_srcu); 39 40 srcu_read_unlock(&file->ubu_dev->ubc_dev_srcu, srcu_idx); 41 42 if (atomic_dec_and_test(&file->ubu_dev->refcnt)) 43 complete(&file->ubu_dev->comp); 44 45 kobject_put(&file->ubu_dev->kobj); 46 kfree(file); 47 } 48 > 49 int uburma_open(struct inode *inode, struct file *filp) 50 { 51 struct uburma_device *ubu_dev; 52 struct ubcore_device *ubc_dev; 53 struct uburma_file *file; 54 int srcu_idx; 55 int ret; 56 57 ubu_dev = container_of(inode->i_cdev, struct uburma_device, cdev); 58 if (!atomic_inc_not_zero(&ubu_dev->refcnt)) { 59 uburma_log_err("device was not ready.\n"); 60 return -ENXIO; 61 } 62 63 srcu_idx = srcu_read_lock(&ubu_dev->ubc_dev_srcu); 64 mutex_lock(&ubu_dev->lists_mutex); 65 ubc_dev = srcu_dereference(ubu_dev->ubc_dev, &ubu_dev->ubc_dev_srcu); > 66 if (ubc_dev == NULL || ubc_dev->dev_name == NULL) { 67 uburma_log_err("can not find ubcore device.\n"); 68 ret = EIO; 69 goto err; 70 } 71 72 file = kzalloc(sizeof(struct uburma_file), GFP_KERNEL); 73 if (!file) { 74 ret = -ENOMEM; 75 uburma_log_err("can not alloc memory.\n"); 76 goto err; 77 } 78 79 file->ubu_dev = ubu_dev; 80 file->ucontext = NULL; 81 kref_init(&file->ref); 82 mutex_init(&file->mutex); 83 filp->private_data = file; 84 85 list_add_tail(&file->list, &ubu_dev->uburma_file_list); 86 kobject_get(&ubu_dev->kobj); // Increase reference count for file. 87 88 mutex_unlock(&ubu_dev->lists_mutex); 89 srcu_read_unlock(&ubu_dev->ubc_dev_srcu, srcu_idx); 90 91 uburma_log_info("device: %s open succeed.\n", ubc_dev->dev_name); 92 return nonseekable_open(inode, filp); 93 94 err: 95 mutex_unlock(&ubu_dev->lists_mutex); 96 srcu_read_unlock(&ubu_dev->ubc_dev_srcu, srcu_idx); 97 if (atomic_dec_and_test(&ubu_dev->refcnt)) 98 complete(&ubu_dev->comp); 99 return ret; 100 } 101 > 102 int uburma_close(struct inode *inode, struct file *filp) -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki