Skip to content

Commit 1d69ab8

Browse files
emuslngregkh
authored andcommitted
pds_core: make pdsc_auxbus_dev_del() void
[ Upstream commit e8562da ] Since there really is no useful return, advertising a return value is rather misleading. Make pdsc_auxbus_dev_del() a void function. Link: https://patch.msgid.link/r/[email protected] Reviewed-by: Leon Romanovsky <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Stable-dep-of: dfd7601 ("pds_core: remove write-after-free of client_id") Signed-off-by: Sasha Levin <[email protected]>
1 parent aea3ca6 commit 1d69ab8

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

drivers/net/ethernet/amd/pds_core/auxbus.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,9 @@ static struct pds_auxiliary_dev *pdsc_auxbus_dev_register(struct pdsc *cf,
172172
return padev;
173173
}
174174

175-
int pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf)
175+
void pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf)
176176
{
177177
struct pds_auxiliary_dev *padev;
178-
int err = 0;
179-
180-
if (!cf)
181-
return -ENODEV;
182178

183179
mutex_lock(&pf->config_lock);
184180

@@ -192,7 +188,6 @@ int pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf)
192188
pf->vfs[cf->vf_id].padev = NULL;
193189

194190
mutex_unlock(&pf->config_lock);
195-
return err;
196191
}
197192

198193
int pdsc_auxbus_dev_add(struct pdsc *cf, struct pdsc *pf)

drivers/net/ethernet/amd/pds_core/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ int pdsc_register_notify(struct notifier_block *nb);
304304
void pdsc_unregister_notify(struct notifier_block *nb);
305305
void pdsc_notify(unsigned long event, void *data);
306306
int pdsc_auxbus_dev_add(struct pdsc *cf, struct pdsc *pf);
307-
int pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf);
307+
void pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf);
308308

309309
void pdsc_process_adminq(struct pdsc_qcq *qcq);
310310
void pdsc_work_thread(struct work_struct *work);

drivers/net/ethernet/amd/pds_core/devlink.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ int pdsc_dl_enable_set(struct devlink *dl, u32 id,
5656
for (vf_id = 0; vf_id < pdsc->num_vfs; vf_id++) {
5757
struct pdsc *vf = pdsc->vfs[vf_id].vf;
5858

59-
err = ctx->val.vbool ? pdsc_auxbus_dev_add(vf, pdsc) :
60-
pdsc_auxbus_dev_del(vf, pdsc);
59+
if (ctx->val.vbool)
60+
err = pdsc_auxbus_dev_add(vf, pdsc);
61+
else
62+
pdsc_auxbus_dev_del(vf, pdsc);
6163
}
6264

6365
return err;

0 commit comments

Comments
 (0)