lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180201170312.GD12838@kroah.com>
Date:   Thu, 1 Feb 2018 18:03:12 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Stanislav Nijnikov <stanislav.nijnikov@....com>
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        jaegeuk@...nel.org, alex.lemberg@....com
Subject: Re: [PATCH v4 10/10] ufs: sysfs: attributes

On Thu, Feb 01, 2018 at 06:15:46PM +0200, Stanislav Nijnikov wrote:
> +#define UFS_LUN_ATTRIBUTE(_name, _uname)                                      \
> +static ssize_t _name##_attribute_show(struct device *dev,                     \
> +	struct device_attribute *attr, char *buf)                             \
> +{                                                                             \
> +	u32 value;                                                            \
> +	struct scsi_device *sdev = to_scsi_device(dev);                       \
> +	struct ufs_hba *hba = shost_priv(sdev->host);                         \
> +	u8 lun = ufshcd_scsi_to_upiu_lun(sdev->lun);                          \
> +	if (ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR,               \
> +		QUERY_ATTR_IDN##_uname, lun, 0, &value))                      \
> +		return -EINVAL;                                               \
> +	return sprintf(buf, "0x%08X\n", value);                               \
> +}                                                                             \
> +static DEVICE_ATTR_RO(_name##_attribute)
> +
> +UFS_LUN_ATTRIBUTE(dyn_cap_needed, _DYN_CAP_NEEDED);

Why create a macro when you only have one instance of its use?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ