mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: corbet@lwn.net, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	mahesh@linux.vnet.ibm.com, hbathini@linux.ibm.com
Subject: Re: [PATCH v5 3/6] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files
Date: Tue, 10 Dec 2019 07:12:34 +0530	[thread overview]
Message-ID: <64537bac-5fc3-bda8-4cac-338436b30d3e@linux.ibm.com> (raw)
In-Reply-To: <20191209081023.GC706232@kroah.com>



On 12/9/19 1:40 PM, Greg KH wrote:
> On Mon, Dec 09, 2019 at 10:28:23AM +0530, Sourabh Jain wrote:
>> +#define CREATE_SYMLINK(target, symlink_name) do {\
>> +	rc = compat_only_sysfs_link_entry_to_kobj(kernel_kobj, fadump_kobj, \
>> +						  target, symlink_name); \
>> +	if (rc) \
>> +		pr_err("unable to create %s symlink (%d)", symlink_name, rc); \
>> +} while (0)
> 
> 
> No need for a macro, just spell it all out.  And properly clean up if an
> error happens, you are just printing it out and moving on, which is
> probably NOT what you want to do, right?

Yeah actually there is no point in keeping the fadump_enabled symlink if fadump_registered
symlink creation fails.

And it is even better to unregister the FADump if fadump_group creation fails.

> 
>> +static struct attribute_group fadump_group = {
>> +	.attrs = fadump_attrs,
>> +};
> 
> ATTRIBUTE_GROUPS()?

Thanks, I will use this macro.

-Sourabh Jain




  reply	other threads:[~2019-12-10  1:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09  4:58 [PATCH v5 0/6] reorganize and add FADump " Sourabh Jain
2019-12-09  4:58 ` [PATCH v5 1/6] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_* Sourabh Jain
2019-12-09  4:58 ` [PATCH v5 2/6] sysfs: wrap __compat_only_sysfs_link_entry_to_kobj function to change the symlink name Sourabh Jain
2019-12-09  4:58 ` [PATCH v5 3/6] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files Sourabh Jain
2019-12-09  8:10   ` Greg KH
2019-12-10  1:42     ` Sourabh Jain [this message]
2019-12-09  4:58 ` [PATCH v5 4/6] powerpc/powernv: move core and fadump_release_opalcore under new kobject Sourabh Jain
2019-12-09  4:58 ` [PATCH v5 5/6] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated Sourabh Jain
2019-12-09  4:58 ` [PATCH v5 6/6] powerpc/fadump: sysfs for fadump memory reservation Sourabh Jain

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=64537bac-5fc3-bda8-4cac-338436b30d3e@linux.ibm.com \
    --to=sourabhjain@linux.ibm.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hbathini@linux.ibm.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahesh@linux.vnet.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

Powered by JetHome