Re: __assign_str handling

Brian Witte <[email protected]> Mon, 17 Jun 2024 11:53:48 -0500
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
Hi Johannes,

I am unsure here, but I looked at Steven's commit removing it:
2c92ca849fcc6ee7d0c358e9959abc9f58661aea

I was wondering if a variadic macro makes sense:
https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html

I don't know much about how they are used in kernel and searched the kernel's
src and came across your commit here:
568db7fd27fad183d186742dc7ae6ca211ba51ff

You introduced the IWL_FW_CHECK macro for the iwlwifi driver which seems to
handle additional logging parameters well.

Could we modify __assign_str to handle variadic inputs?

For example:

  #define __assign_str(dst, ...) __assign_str_helper(dst, ##__VA_ARGS__)

The helper function could resolve the assignment based on the count/context of
the arguments.

Fwiw, I am still familiarizing myself with kernel conventions and
backport-related modifications so perhaps this is a no-go.

Figured I'd share my thoughts since I have been running `gentree.py` again...

-- 
regards,
brian witte