From: Vasily Gorbik <gor@linux.ibm.com>
To: Alexandra Winter <wintera@linux.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH 2/2] s390/iucv: Fix vargs handling in iucv_alloc_device()
Date: Tue, 13 Aug 2024 16:36:01 +0200 [thread overview]
Message-ID: <your-ad-here.call-01723559761-ext-3660@work.hours> (raw)
In-Reply-To: <221ba279-e48b-4002-9530-c6186e3e8042@linux.ibm.com>
On Tue, Aug 13, 2024 at 03:35:48PM +0200, Alexandra Winter wrote:
>
>
> On 13.08.24 14:43, Greg Kroah-Hartman wrote:
> >>> I don't understand, why can't dev_set_name() be called here?
> >>>
> [...]
> >
> > But step back, why is this needed at all anyway? No other subsystem or
> > driver needs/wants this, what makes this api so special? Why not figure
> > out your name beforehand?
> >
> > thanks,
>
>
> Vasily, the following update to Heiko's patch does not touch lib/kobject.c
> According to a quick test it still solves the original issue and does compile
> with W=1 and iucv as a module.
>
> diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
> index 64102a31b569..6a819ba4ccab 100644
> --- a/net/iucv/iucv.c
> +++ b/net/iucv/iucv.c
> @@ -86,13 +86,17 @@ struct device *iucv_alloc_device(const struct attribute_group **attrs,
> {
> struct device *dev;
> va_list vargs;
> + char buf[20];
> int rc;
>
> dev = kzalloc(sizeof(*dev), GFP_KERNEL);
> if (!dev)
> goto out_error;
> va_start(vargs, fmt);
> - rc = kobject_set_name_vargs(&dev->kobj, fmt, vargs);
> + rc = vsnprintf(buf, 20, fmt, vargs);
> + if (!rc)
> + rc = dev_set_name(dev, buf);
> va_end(vargs);
> if (rc)
> goto out_error;
>
> Maybe Greg has somethign like this in mind?
Thanks Alexandra,
but I'm still leaning towards forwarding vargs and avoid splitting the name
formatting logic, if Greg agrees that the use case justifies adding a
new helper. Let's see what Greg prefers.
int dev_set_name_vargs(struct device *dev, const char *fmt, va_list vargs)
{
return kobject_set_name_vargs(&dev->kobj, fmt, vargs);
}
EXPORT_SYMBOL_GPL(dev_set_name_vargs)
next prev parent reply other threads:[~2024-08-13 14:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 10:42 [PATCH 0/2] Fix vargs handling in iucv_alloc_device() Vasily Gorbik
2024-08-13 10:42 ` [PATCH 1/2] kobject: Export kobject_set_name_vargs() symbol Vasily Gorbik
2024-08-13 10:51 ` Greg Kroah-Hartman
2024-08-13 10:42 ` [PATCH 2/2] s390/iucv: Fix vargs handling in iucv_alloc_device() Vasily Gorbik
2024-08-13 10:52 ` Greg Kroah-Hartman
2024-08-13 11:50 ` Vasily Gorbik
2024-08-13 12:43 ` Greg Kroah-Hartman
2024-08-13 13:09 ` Vasily Gorbik
2024-08-13 13:35 ` Alexandra Winter
2024-08-13 14:36 ` Vasily Gorbik [this message]
2024-08-13 15:29 ` Greg Kroah-Hartman
2024-08-13 18:21 ` Vasily Gorbik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=your-ad-here.call-01723559761-ext-3660@work.hours \
--to=gor@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=wintera@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox