Re: [PATCH 1/6] scsi: Add ufs transport class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Avri,

On Wed, Aug 01, 2018 at 11:04:27AM +0300, Avri Altman wrote:
[...

> +#include <linux/bsg.h>

Why do you include bsg.h here and bsg-lib.h in the scsi_transport_ufs.h?

[...]

> +#define to_ufs_internal(tmpl)	container_of(tmpl, struct ufs_internal, t)

I'd personally prefer this to be a inline function instead of a define
for type safety reasons.

> +
> +struct ufs_host_attrs {
> +	atomic_t next_port_id;
> +};
> +#define to_ufs_host_attrs(x) ((struct ufs_host_attrs *)(x)->shost_data)

Ditto.

[...]

> +
> +	port->id = atomic_inc_return(&ufs_host->next_port_id);

Any reason you can't use an IDA for the port->id?

[...]
> +
> +	error = device_add(dev);
> +
> +	if (error)
> +		return error;

No blank line please.

[...]

> +#define dev_to_ufs_port(d) \
> +	container_of((d), struct ufs_port, dev)

Inline function as well, please.

-- 
Johannes Thumshirn                                          Storage
jthumshirn@xxxxxxx                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux