All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [geoff-ps3:ps3-queue-v6.9 16/17] arch/powerpc/platforms/ps3/device-init.c:785:17-23: ERROR: application of sizeof to pointer
@ 2024-04-01  3:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-01  3:08 UTC (permalink / raw
  To: Geoff Levand; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/geoff/ps3-linux.git ps3-queue-v6.9
head:   dc948075b6eb13520ec93b1739a5bd6270e2803d
commit: 187f6e3cc0d1111a352b95ad3da531c436b84984 [16/17] powerpc/ps3: Fix allmodconfig warning
config: powerpc64-randconfig-r054-20240401 (https://download.01.org/0day-ci/archive/20240401/202404011140.XIsjBjur-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 546dc2245ffc4cccd0b05b58b7a5955e355a3b27)

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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404011140.XIsjBjur-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> arch/powerpc/platforms/ps3/device-init.c:785:17-23: ERROR: application of sizeof to pointer

vim +785 arch/powerpc/platforms/ps3/device-init.c

   760	
   761	/**
   762	 * ps3_probe_thread - Background repository probing at system startup.
   763	 *
   764	 * This implementation only supports background probing on a single bus.
   765	 * It uses the hypervisor's storage device notification mechanism to wait until
   766	 * a storage device is ready.  The device notification mechanism uses a
   767	 * pseudo device to asynchronously notify the guest when storage devices become
   768	 * ready.  The notification device has a block size of 512 bytes.
   769	 */
   770	
   771	static int ps3_probe_thread(void *data)
   772	{
   773		struct {
   774			struct ps3_notification_device dev;
   775			u8 buf[512];
   776		} *local;
   777		struct ps3_notify_cmd *notify_cmd;
   778		struct ps3_notify_event *notify_event;
   779		int res;
   780		unsigned int irq;
   781		u64 lpar;
   782	
   783		pr_debug(" -> %s:%u: kthread started\n", __func__, __LINE__);
   784	
 > 785		local = kzalloc(sizeof(local), GFP_KERNEL);
   786		if (!local)
   787			return -ENOMEM;
   788	
   789		lpar = ps3_mm_phys_to_lpar(__pa(&local->buf));
   790		notify_cmd = (struct ps3_notify_cmd *)&local->buf;
   791		notify_event = (struct ps3_notify_event *)&local->buf;
   792	
   793		/* dummy system bus device */
   794		local->dev.sbd.bus_id = (u64)data;
   795		local->dev.sbd.dev_id = PS3_NOTIFICATION_DEV_ID;
   796		local->dev.sbd.interrupt_id = PS3_NOTIFICATION_INTERRUPT_ID;
   797	
   798		res = lv1_open_device(local->dev.sbd.bus_id, local->dev.sbd.dev_id, 0);
   799		if (res) {
   800			pr_err("%s:%u: lv1_open_device failed %s\n", __func__,
   801			       __LINE__, ps3_result(res));
   802			goto fail_free;
   803		}
   804	
   805		res = ps3_sb_event_receive_port_setup(&local->dev.sbd,
   806			PS3_BINDING_CPU_ANY, &irq);
   807		if (res) {
   808			pr_err("%s:%u: ps3_sb_event_receive_port_setup failed %d\n",
   809			       __func__, __LINE__, res);
   810		       goto fail_close_device;
   811		}
   812	
   813		spin_lock_init(&local->dev.lock);
   814		rcuwait_init(&local->dev.wait);
   815	
   816		res = request_irq(irq, ps3_notification_interrupt, 0,
   817				  "ps3_notification", &local->dev);
   818		if (res) {
   819			pr_err("%s:%u: request_irq failed %d\n", __func__, __LINE__,
   820			       res);
   821			goto fail_sb_event_receive_port_destroy;
   822		}
   823	
   824		/* Setup and write the request for device notification. */
   825		notify_cmd->operation_code = 0; /* must be zero */
   826		notify_cmd->event_mask = 1UL << notify_region_probe;
   827	
   828		res = ps3_notification_read_write(&local->dev, lpar, 1);
   829		if (res)
   830			goto fail_free_irq;
   831	
   832		set_freezable();
   833		/* Loop here processing the requested notification events. */
   834		do {
   835			try_to_freeze();
   836	
   837			memset(notify_event, 0, sizeof(*notify_event));
   838	
   839			res = ps3_notification_read_write(&local->dev, lpar, 0);
   840			if (res)
   841				break;
   842	
   843			pr_debug("%s:%u: notify event type 0x%llx bus id %llu dev id %llu"
   844				 " type %llu port %llu\n", __func__, __LINE__,
   845				notify_event->event_type, notify_event->bus_id,
   846				notify_event->dev_id, notify_event->dev_type,
   847				notify_event->dev_port);
   848	
   849			if (notify_event->event_type != notify_region_probe ||
   850				notify_event->bus_id != local->dev.sbd.bus_id) {
   851				pr_warn("%s:%u: bad notify_event: event %llu, dev_id %llu, dev_type %llu\n",
   852					__func__, __LINE__, notify_event->event_type,
   853					notify_event->dev_id, notify_event->dev_type);
   854				continue;
   855			}
   856	
   857			ps3_find_and_add_device(local->dev.sbd.bus_id,
   858				notify_event->dev_id);
   859	
   860		} while (!kthread_should_stop());
   861	
   862	fail_free_irq:
   863		free_irq(irq, &local->dev);
   864	fail_sb_event_receive_port_destroy:
   865		ps3_sb_event_receive_port_destroy(&local->dev.sbd, irq);
   866	fail_close_device:
   867		lv1_close_device(local->dev.sbd.bus_id, local->dev.sbd.dev_id);
   868	fail_free:
   869		kfree(local);
   870	
   871		probe_task = NULL;
   872	
   873		pr_debug(" <- %s:%u: kthread finished\n", __func__, __LINE__);
   874	
   875		return 0;
   876	}
   877	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-01  3:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-01  3:08 [geoff-ps3:ps3-queue-v6.9 16/17] arch/powerpc/platforms/ps3/device-init.c:785:17-23: ERROR: application of sizeof to pointer kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.