@@ -120,18 +120,20 @@ static inline void *scatterwalk_map(struct scatter_walk *walk)
120
120
* scatterwalk_next() - Get the next data buffer in a scatterlist walk
121
121
* @walk: the scatter_walk
122
122
* @total: the total number of bytes remaining, > 0
123
- * @nbytes_ret: (out) the next number of bytes available, <= @total
124
123
*
125
- * Return: A virtual address for the next segment of data from the scatterlist.
126
- * The caller must call scatterwalk_done_src() or scatterwalk_done_dst()
127
- * when it is done using this virtual address.
124
+ * A virtual address for the next segment of data from the scatterlist will
125
+ * be placed into @walk->addr. The caller must call scatterwalk_done_src()
126
+ * or scatterwalk_done_dst() when it is done using this virtual address.
127
+ *
128
+ * Returns: the next number of bytes available, <= @total
128
129
*/
129
- static inline void * scatterwalk_next (struct scatter_walk * walk ,
130
- unsigned int total ,
131
- unsigned int * nbytes_ret )
130
+ static inline unsigned int scatterwalk_next (struct scatter_walk * walk ,
131
+ unsigned int total )
132
132
{
133
- * nbytes_ret = scatterwalk_clamp (walk , total );
134
- return scatterwalk_map (walk );
133
+ unsigned int nbytes = scatterwalk_clamp (walk , total );
134
+
135
+ walk -> __addr = scatterwalk_map (walk );
136
+ return nbytes ;
135
137
}
136
138
137
139
static inline void scatterwalk_unmap (const void * vaddr )
@@ -149,32 +151,31 @@ static inline void scatterwalk_advance(struct scatter_walk *walk,
149
151
/**
150
152
* scatterwalk_done_src() - Finish one step of a walk of source scatterlist
151
153
* @walk: the scatter_walk
152
- * @vaddr: the address returned by scatterwalk_next()
153
154
* @nbytes: the number of bytes processed this step, less than or equal to the
154
155
* number of bytes that scatterwalk_next() returned.
155
156
*
156
- * Use this if the @vaddr was not written to, i.e. it is source data.
157
+ * Use this if the mapped address was not written to, i.e. it is source data.
157
158
*/
158
159
static inline void scatterwalk_done_src (struct scatter_walk * walk ,
159
- const void * vaddr , unsigned int nbytes )
160
+ unsigned int nbytes )
160
161
{
161
- scatterwalk_unmap (vaddr );
162
+ scatterwalk_unmap (walk -> addr );
162
163
scatterwalk_advance (walk , nbytes );
163
164
}
164
165
165
166
/**
166
167
* scatterwalk_done_dst() - Finish one step of a walk of destination scatterlist
167
168
* @walk: the scatter_walk
168
- * @vaddr: the address returned by scatterwalk_next()
169
169
* @nbytes: the number of bytes processed this step, less than or equal to the
170
170
* number of bytes that scatterwalk_next() returned.
171
171
*
172
- * Use this if the @vaddr may have been written to, i.e. it is destination data.
172
+ * Use this if the mapped address may have been written to, i.e. it is
173
+ * destination data.
173
174
*/
174
175
static inline void scatterwalk_done_dst (struct scatter_walk * walk ,
175
- void * vaddr , unsigned int nbytes )
176
+ unsigned int nbytes )
176
177
{
177
- scatterwalk_unmap (vaddr );
178
+ scatterwalk_unmap (walk -> addr );
178
179
/*
179
180
* Explicitly check ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE instead of just
180
181
* relying on flush_dcache_page() being a no-op when not implemented,
0 commit comments