Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
89a07be0
Commit
89a07be0
authored
Jan 09, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sysfs: fix up SCSI sysfs files.
Remove @count and @off parameters from show() and store() callbacks.
parent
8575d409
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
20 deletions
+9
-20
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_sysfs.c
+9
-20
No files found.
drivers/scsi/scsi_sysfs.c
View file @
89a07be0
...
...
@@ -23,20 +23,16 @@
* Return:
* number of bytes written into page.
**/
static
ssize_t
scsi_host_class_name_show
(
struct
device
*
dev
,
char
*
page
,
size_t
count
,
loff_t
off
)
static
ssize_t
scsi_host_class_name_show
(
struct
device
*
dev
,
char
*
page
)
{
struct
Scsi_Host
*
shost
;
if
(
off
)
return
0
;
shost
=
to_scsi_host
(
dev
);
if
(
!
shost
)
return
0
;
return
snprintf
(
page
,
count
,
"scsi%d
\n
"
,
shost
->
host_no
);
return
snprintf
(
page
,
20
,
"scsi%d
\n
"
,
shost
->
host_no
);
}
DEVICE_ATTR
(
class_name
,
S_IRUGO
,
scsi_host_class_name_show
,
NULL
);
...
...
@@ -138,13 +134,11 @@ void scsi_upper_driver_unregister(struct Scsi_Device_Template *sdev_tp)
*/
#define show_function(field, format_string) \
static ssize_t \
show_##field (struct device *dev, char *buf
, size_t count, loff_t off)
\
show_##field (struct device *dev, char *buf
)
\
{ \
struct scsi_device *sdev; \
if (off) \
return 0; \
sdev = to_scsi_device(dev); \
return snprintf (buf,
count, format_string, sdev->field);
\
return snprintf (buf,
20, format_string, sdev->field);
\
} \
/*
...
...
@@ -164,14 +158,12 @@ static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL)
show_function(field, format_string) \
\
static ssize_t \
store_##field (struct device *dev, const char *buf
, size_t count, loff_t off)
\
store_##field (struct device *dev, const char *buf
)
\
{ \
struct scsi_device *sdev; \
\
if (off) \
return 0; \
sdev = to_scsi_device(dev); \
return snscanf (buf, count, format_string, &sdev->field); \
snscanf (buf, 20, format_string, &sdev->field); \
return strlen(buf); \
} \
static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field)
...
...
@@ -183,18 +175,15 @@ static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field)
show_function(field, "%d\n") \
\
static ssize_t \
store_##field (struct device *dev, const char *buf
, size_t count, loff_t off)
\
store_##field (struct device *dev, const char *buf
)
\
{ \
int ret; \
struct scsi_device *sdev; \
\
if (off) \
return 0; \
ret = scsi_sdev_check_buf_bit(buf); \
if (ret >= 0) { \
sdev = to_scsi_device(dev); \
sdev->field = ret; \
ret =
count;
\
ret =
strlen(buf);
\
} \
return ret; \
} \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment