Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts
       [not found] <20240804130225.243496-18-o-takashi@sakamocchi.jp>
@ 2024-08-04 22:31 ` kernel test robot
  2024-08-04 23:33 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2024-08-04 22:31 UTC (permalink / raw)
  To: Takashi Sakamoto, linux1394-devel; +Cc: llvm, oe-kbuild-all, linux-kernel

Hi Takashi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on ieee1394-linux1394/for-next]
[also build test WARNING on ieee1394-linux1394/for-linus linus/master v6.11-rc1 next-20240802]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Takashi-Sakamoto/firewire-core-use-guard-macro-to-maintain-static-packet-data-for-phy-configuration/20240804-210645
base:   https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git for-next
patch link:    https://lore.kernel.org/r/20240804130225.243496-18-o-takashi%40sakamocchi.jp
patch subject: [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240805/202408050633.0nI12cmo-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240805/202408050633.0nI12cmo-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408050633.0nI12cmo-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/firewire/ohci.c:3138:2: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
    3138 |         guard(spinlock_irq)(&ohci->lock);
         |         ^
   include/linux/cleanup.h:167:2: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |         ^
   include/linux/cleanup.h:122:2: note: expanded from macro 'CLASS'
     122 |         class_##_name##_t var __cleanup(class_##_name##_destructor) =   \
         |         ^
   <scratch space>:86:1: note: expanded from here
      86 | class_spinlock_irq_t
         | ^
   1 warning generated.


vim +3138 drivers/firewire/ohci.c

  3059	
  3060	static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card,
  3061					int type, int channel, size_t header_size)
  3062	{
  3063		struct fw_ohci *ohci = fw_ohci(card);
  3064		struct iso_context *ctx;
  3065		descriptor_callback_t callback;
  3066		u64 *channels;
  3067		u32 *mask, regs;
  3068		int index, ret = -EBUSY;
  3069	
  3070		scoped_guard(spinlock_irq, &ohci->lock) {
  3071			switch (type) {
  3072			case FW_ISO_CONTEXT_TRANSMIT:
  3073				mask     = &ohci->it_context_mask;
  3074				callback = handle_it_packet;
  3075				index    = ffs(*mask) - 1;
  3076				if (index >= 0) {
  3077					*mask &= ~(1 << index);
  3078					regs = OHCI1394_IsoXmitContextBase(index);
  3079					ctx  = &ohci->it_context_list[index];
  3080				}
  3081				break;
  3082	
  3083			case FW_ISO_CONTEXT_RECEIVE:
  3084				channels = &ohci->ir_context_channels;
  3085				mask     = &ohci->ir_context_mask;
  3086				callback = handle_ir_packet_per_buffer;
  3087				index    = *channels & 1ULL << channel ? ffs(*mask) - 1 : -1;
  3088				if (index >= 0) {
  3089					*channels &= ~(1ULL << channel);
  3090					*mask     &= ~(1 << index);
  3091					regs = OHCI1394_IsoRcvContextBase(index);
  3092					ctx  = &ohci->ir_context_list[index];
  3093				}
  3094				break;
  3095	
  3096			case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
  3097				mask     = &ohci->ir_context_mask;
  3098				callback = handle_ir_buffer_fill;
  3099				index    = !ohci->mc_allocated ? ffs(*mask) - 1 : -1;
  3100				if (index >= 0) {
  3101					ohci->mc_allocated = true;
  3102					*mask &= ~(1 << index);
  3103					regs = OHCI1394_IsoRcvContextBase(index);
  3104					ctx  = &ohci->ir_context_list[index];
  3105				}
  3106				break;
  3107	
  3108			default:
  3109				index = -1;
  3110				ret = -ENOSYS;
  3111			}
  3112	
  3113			if (index < 0)
  3114				return ERR_PTR(ret);
  3115		}
  3116	
  3117		memset(ctx, 0, sizeof(*ctx));
  3118		ctx->header_length = 0;
  3119		ctx->header = (void *) __get_free_page(GFP_KERNEL);
  3120		if (ctx->header == NULL) {
  3121			ret = -ENOMEM;
  3122			goto out;
  3123		}
  3124		ret = context_init(&ctx->context, ohci, regs, callback);
  3125		if (ret < 0)
  3126			goto out_with_header;
  3127	
  3128		if (type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) {
  3129			set_multichannel_mask(ohci, 0);
  3130			ctx->mc_completed = 0;
  3131		}
  3132	
  3133		return &ctx->base;
  3134	
  3135	 out_with_header:
  3136		free_page((unsigned long)ctx->header);
  3137	 out:
> 3138		guard(spinlock_irq)(&ohci->lock);
  3139	
  3140		switch (type) {
  3141		case FW_ISO_CONTEXT_RECEIVE:
  3142			*channels |= 1ULL << channel;
  3143			break;
  3144	
  3145		case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
  3146			ohci->mc_allocated = false;
  3147			break;
  3148		}
  3149		*mask |= 1 << index;
  3150	
  3151		return ERR_PTR(ret);
  3152	}
  3153	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts
       [not found] <20240804130225.243496-18-o-takashi@sakamocchi.jp>
  2024-08-04 22:31 ` [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts kernel test robot
@ 2024-08-04 23:33 ` kernel test robot
  2024-08-05  8:33   ` Takashi Sakamoto
  1 sibling, 1 reply; 3+ messages in thread
From: kernel test robot @ 2024-08-04 23:33 UTC (permalink / raw)
  To: Takashi Sakamoto, linux1394-devel; +Cc: llvm, oe-kbuild-all, linux-kernel

Hi Takashi,

kernel test robot noticed the following build errors:

[auto build test ERROR on ieee1394-linux1394/for-next]
[also build test ERROR on ieee1394-linux1394/for-linus linus/master v6.11-rc1 next-20240802]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Takashi-Sakamoto/firewire-core-use-guard-macro-to-maintain-static-packet-data-for-phy-configuration/20240804-210645
base:   https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git for-next
patch link:    https://lore.kernel.org/r/20240804130225.243496-18-o-takashi%40sakamocchi.jp
patch subject: [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts
config: arm64-randconfig-003-20240805 (https://download.01.org/0day-ci/archive/20240805/202408050730.y1eyRcTv-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240805/202408050730.y1eyRcTv-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408050730.y1eyRcTv-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/firewire/ohci.c:3138:2: error: expected expression
    3138 |         guard(spinlock_irq)(&ohci->lock);
         |         ^
   include/linux/cleanup.h:167:2: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |         ^
   include/linux/cleanup.h:122:2: note: expanded from macro 'CLASS'
     122 |         class_##_name##_t var __cleanup(class_##_name##_destructor) =   \
         |         ^
   <scratch space>:133:1: note: expanded from here
     133 | class_spinlock_irq_t
         | ^
   1 error generated.


vim +3138 drivers/firewire/ohci.c

  3059	
  3060	static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card,
  3061					int type, int channel, size_t header_size)
  3062	{
  3063		struct fw_ohci *ohci = fw_ohci(card);
  3064		struct iso_context *ctx;
  3065		descriptor_callback_t callback;
  3066		u64 *channels;
  3067		u32 *mask, regs;
  3068		int index, ret = -EBUSY;
  3069	
  3070		scoped_guard(spinlock_irq, &ohci->lock) {
  3071			switch (type) {
  3072			case FW_ISO_CONTEXT_TRANSMIT:
  3073				mask     = &ohci->it_context_mask;
  3074				callback = handle_it_packet;
  3075				index    = ffs(*mask) - 1;
  3076				if (index >= 0) {
  3077					*mask &= ~(1 << index);
  3078					regs = OHCI1394_IsoXmitContextBase(index);
  3079					ctx  = &ohci->it_context_list[index];
  3080				}
  3081				break;
  3082	
  3083			case FW_ISO_CONTEXT_RECEIVE:
  3084				channels = &ohci->ir_context_channels;
  3085				mask     = &ohci->ir_context_mask;
  3086				callback = handle_ir_packet_per_buffer;
  3087				index    = *channels & 1ULL << channel ? ffs(*mask) - 1 : -1;
  3088				if (index >= 0) {
  3089					*channels &= ~(1ULL << channel);
  3090					*mask     &= ~(1 << index);
  3091					regs = OHCI1394_IsoRcvContextBase(index);
  3092					ctx  = &ohci->ir_context_list[index];
  3093				}
  3094				break;
  3095	
  3096			case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
  3097				mask     = &ohci->ir_context_mask;
  3098				callback = handle_ir_buffer_fill;
  3099				index    = !ohci->mc_allocated ? ffs(*mask) - 1 : -1;
  3100				if (index >= 0) {
  3101					ohci->mc_allocated = true;
  3102					*mask &= ~(1 << index);
  3103					regs = OHCI1394_IsoRcvContextBase(index);
  3104					ctx  = &ohci->ir_context_list[index];
  3105				}
  3106				break;
  3107	
  3108			default:
  3109				index = -1;
  3110				ret = -ENOSYS;
  3111			}
  3112	
  3113			if (index < 0)
  3114				return ERR_PTR(ret);
  3115		}
  3116	
  3117		memset(ctx, 0, sizeof(*ctx));
  3118		ctx->header_length = 0;
  3119		ctx->header = (void *) __get_free_page(GFP_KERNEL);
  3120		if (ctx->header == NULL) {
  3121			ret = -ENOMEM;
  3122			goto out;
  3123		}
  3124		ret = context_init(&ctx->context, ohci, regs, callback);
  3125		if (ret < 0)
  3126			goto out_with_header;
  3127	
  3128		if (type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) {
  3129			set_multichannel_mask(ohci, 0);
  3130			ctx->mc_completed = 0;
  3131		}
  3132	
  3133		return &ctx->base;
  3134	
  3135	 out_with_header:
  3136		free_page((unsigned long)ctx->header);
  3137	 out:
> 3138		guard(spinlock_irq)(&ohci->lock);
  3139	
  3140		switch (type) {
  3141		case FW_ISO_CONTEXT_RECEIVE:
  3142			*channels |= 1ULL << channel;
  3143			break;
  3144	
  3145		case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
  3146			ohci->mc_allocated = false;
  3147			break;
  3148		}
  3149		*mask |= 1 << index;
  3150	
  3151		return ERR_PTR(ret);
  3152	}
  3153	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts
  2024-08-04 23:33 ` kernel test robot
@ 2024-08-05  8:33   ` Takashi Sakamoto
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Sakamoto @ 2024-08-05  8:33 UTC (permalink / raw)
  To: kernel test robot; +Cc: linux1394-devel, llvm, oe-kbuild-all, linux-kernel

On Mon, Aug 05, 2024 at 07:33:01AM +0800, kernel test robot wrote:
> url:    https://github.com/intel-lab-lkp/linux/commits/Takashi-Sakamoto/firewire-core-use-guard-macro-to-maintain-static-packet-data-for-phy-configuration/20240804-210645
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git for-next
> patch link:    https://lore.kernel.org/r/20240804130225.243496-18-o-takashi%40sakamocchi.jp
> patch subject: [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts
> config: arm64-randconfig-003-20240805 (https://download.01.org/0day-ci/archive/20240805/202408050730.y1eyRcTv-lkp@intel.com/config)
> compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240805/202408050730.y1eyRcTv-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 <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202408050730.y1eyRcTv-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/firewire/ohci.c:3138:2: error: expected expression
>     3138 |         guard(spinlock_irq)(&ohci->lock);
>          |         ^
>    include/linux/cleanup.h:167:2: note: expanded from macro 'guard'
>      167 |         CLASS(_name, __UNIQUE_ID(guard))
>          |         ^
>    include/linux/cleanup.h:122:2: note: expanded from macro 'CLASS'
>      122 |         class_##_name##_t var __cleanup(class_##_name##_destructor) =   \
>          |         ^
>    <scratch space>:133:1: note: expanded from here
>      133 | class_spinlock_irq_t
>          | ^
>    1 error generated.

The macro expands a declaration, while the line just after the label
should be still any statement in C11.

I'll post take 2 patchset.


Thanks

Takashi Sakamoto

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-05  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240804130225.243496-18-o-takashi@sakamocchi.jp>
2024-08-04 22:31 ` [PATCH 17/17] firewire: ohci: use guard macro to serialize operations for isochronous contexts kernel test robot
2024-08-04 23:33 ` kernel test robot
2024-08-05  8:33   ` Takashi Sakamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox