Drop unlikely with IS_ERR
Subsystems (22)
PATCH 1/1 Drop unlikely with IS_ERR
As we know IS_ERR (and its similar instances) uses unlikely in definition so we don't have to mark unlikely second time.
Signed-off-by xNombre <[email protected]>
--- block/blk-cgroup.c | 2 +- drivers/crypto/caam/caamalg_qi.c | 6 +++--- drivers/crypto/caam/qi.c | 4 ++-- drivers/gpu/drm/i915/i915_gem.c | 8 ++++---- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 2 +- drivers/iio/trigger/iio-trig-loop.c | 2 +- drivers/input/mouse/alps.c | 2 +- drivers/md/dm-integrity.c | 2 +- drivers/md/dm-verity-fec.c | 6 +++--- drivers/md/persistent-data/dm-block-manager.c | 8 ++++---- drivers/net/ethernet/amazon/ena/ena_com.c | 4 ++-- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c | 2 +- drivers/net/ethernet/sun/ldmvsw.c | 2 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- fs/namei.c | 2 +- fs/pstore/platform.c | 2 +- net/core/datagram.c | 2 +- net/ipv6/addrconf.c | 2 +- net/kcm/kcmsock.c | 2 +- 22 files changed, 34 insertions(+), 34 deletions(-)
block/blk-cgroup.c +1 -1
@@ -885,7 +885,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,blkg_free (new_blkg); }else { blkg =blkg_create (pos, q, new_blkg); -if (unlikely (IS_ERR (blkg))) { +if (IS_ERR (blkg)) { ret =PTR_ERR (blkg); goto fail_unlock; }
drivers/crypto/caam/caamalg_qi.c +3 -3
@@ -576,7 +576,7 @@ static struct aead_edesc *aead_edesc_alloc(struct aead_request *req,enum optype op_type = encrypt ?ENCRYPT :DECRYPT ; drv_ctx =get_drv_ctx (ctx, op_type); -if (unlikely (IS_ERR_OR_NULL (drv_ctx))) +if (IS_ERR_OR_NULL (drv_ctx))return (struct aead_edesc *)drv_ctx;/* allocate space for base edesc and hw desc commands, link tables */
@@ -844,7 +844,7 @@ static struct ablkcipher_edesc *ablkcipher_edesc_alloc(struct ablkcipher_requestenum optype op_type = encrypt ?ENCRYPT :DECRYPT ; drv_ctx =get_drv_ctx (ctx, op_type); -if (unlikely (IS_ERR_OR_NULL (drv_ctx))) +if (IS_ERR_OR_NULL (drv_ctx))return (struct ablkcipher_edesc *)drv_ctx; src_nents =sg_nents_for_len (req->src, req->nbytes);
@@ -995,7 +995,7 @@ static struct ablkcipher_edesc *ablkcipher_giv_edesc_alloc(struct caam_drv_ctx *drv_ctx; drv_ctx =get_drv_ctx (ctx,GIVENCRYPT ); -if (unlikely (IS_ERR_OR_NULL (drv_ctx))) +if (IS_ERR_OR_NULL (drv_ctx))return (struct ablkcipher_edesc *)drv_ctx; src_nents =sg_nents_for_len (req->src, req->nbytes);
drivers/crypto/caam/qi.c +2 -2
@@ -324,7 +324,7 @@ int caam_drv_ctx_update(struct caam_drv_ctx *drv_ctx, u32 *sh_desc)/* Create a new req FQ in parked state */ new_fq =create_caam_req_fq (drv_ctx->qidev, drv_ctx->rsp_fq, drv_ctx->context_a,0 ); -if (unlikely (IS_ERR_OR_NULL (new_fq))) { +if (IS_ERR_OR_NULL (new_fq)) {dev_err (qidev,"FQ allocation for shdesc update failed\n" );return PTR_ERR (new_fq); }
@@ -437,7 +437,7 @@ struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev,/* Attach request FQ */ drv_ctx->req_fq =create_caam_req_fq (qidev, drv_ctx->rsp_fq, hwdesc,QMAN_INITFQ_FLAG_SCHED ); -if (unlikely (IS_ERR_OR_NULL (drv_ctx->req_fq))) { +if (IS_ERR_OR_NULL (drv_ctx->req_fq)) {dev_err (qidev,"create_caam_req_fq failed\n" );dma_unmap_single (qidev, hwdesc, size,DMA_BIDIRECTIONAL );kfree (drv_ctx);
drivers/gpu/drm/i915/i915_gem.c +4 -4
@@ -2484,7 +2484,7 @@ static int ____i915_gem_object_get_pages(struct drm_i915_gem_object *obj) } pages = obj->ops->get_pages (obj); -if (unlikely (IS_ERR (pages))) +if (IS_ERR (pages))return PTR_ERR (pages);__i915_gem_object_set_pages (obj, pages);
@@ -2506,7 +2506,7 @@ int __i915_gem_object_get_pages(struct drm_i915_gem_object *obj)if (err)return err; -if (unlikely (IS_ERR_OR_NULL (obj->mm.pages))) { +if (IS_ERR_OR_NULL (obj->mm.pages)) { err =____i915_gem_object_get_pages (obj);if (err) goto unlock;
@@ -2589,7 +2589,7 @@ void *i915_gem_object_pin_map(struct drm_i915_gem_object *obj, type &= ~I915_MAP_OVERRIDE ;if (!atomic_inc_not_zero (&obj->mm.pages_pin_count)) { -if (unlikely (IS_ERR_OR_NULL (obj->mm.pages))) { +if (IS_ERR_OR_NULL (obj->mm.pages)) { ret =____i915_gem_object_get_pages (obj);if (ret) goto err_unlock;
@@ -4007,7 +4007,7 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,lockdep_assert_held (&obj->base.dev->struct_mutex); vma =i915_vma_instance (obj, vm, view); -if (unlikely (IS_ERR (vma))) +if (IS_ERR (vma))return vma;if (i915_vma_misplaced (vma, size, alignment, flags)) {
drivers/gpu/drm/i915/i915_gem_execbuffer.c +1 -1
@@ -703,7 +703,7 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb) } vma =i915_vma_instance (obj, eb->vm,NULL ); -if (unlikely (IS_ERR (vma))) { +if (IS_ERR (vma)) { err =PTR_ERR (vma); goto err_obj; }
drivers/gpu/drm/i915/i915_gem_gtt.c +1 -1
@@ -3361,7 +3361,7 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma) } ret =0 ; -if (unlikely (IS_ERR (vma->pages))) { +if (IS_ERR (vma->pages)) { ret =PTR_ERR (vma->pages); vma->pages =NULL ; DRM_ERROR("Failed to get pages for VMA view type %u (%d)!\n",
drivers/gpu/drm/vmwgfx/vmwgfx_context.c +1 -1
@@ -210,7 +210,7 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,for (i =0 ; i <SVGA_COTABLE_DX10_MAX ; ++i) { uctx->cotables[i] =vmw_cotable_alloc (dev_priv, &uctx->res, i); -if (unlikely (IS_ERR (uctx->cotables[i]))) { +if (IS_ERR (uctx->cotables[i])) { ret =PTR_ERR (uctx->cotables[i]); goto out_cotables; }
drivers/iio/trigger/iio-trig-loop.c +1 -1
@@ -60,7 +60,7 @@ static int iio_loop_trigger_set_state(struct iio_trigger *trig, bool state)if (state) { loop_trig->task =kthread_run (iio_loop_thread, trig, trig->name); -if (unlikely (IS_ERR (loop_trig->task))) { +if (IS_ERR (loop_trig->task)) {dev_err (&trig->dev,"failed to create trigger loop thread\n" );return PTR_ERR (loop_trig->task);
drivers/input/mouse/alps.c +1 -1
@@ -1486,7 +1486,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,/* On V2 devices the DualPoint Stick reports bare packets */ dev = priv->dev2; dev2 = psmouse->dev; - }else if (unlikely (IS_ERR_OR_NULL (priv->dev3))) { + }else if (IS_ERR_OR_NULL (priv->dev3)) {/* Register dev3 mouse if we received PS/2 packet first time */ if (!IS_ERR (priv->dev3)) psmouse_queue_work(psmouse, &priv->dev3_register_work,
drivers/md/dm-integrity.c +1 -1
@@ -1036,7 +1036,7 @@ static int dm_integrity_rw_tag(struct dm_integrity_c *ic, unsigned char *tag, sereturn r; data =dm_bufio_read (ic->bufio, *metadata_block, &b); -if (unlikely (IS_ERR (data))) +if (IS_ERR (data))return PTR_ERR (data); to_copy =min ((1U <<SECTOR_SHIFT << ic->log2_buffer_sectors) - *metadata_offset, total_size);
drivers/md/dm-verity-fec.c +3 -3
@@ -73,7 +73,7 @@ static u8 *fec_read_parity(struct dm_verity *v, u64 rsb, int index, *offset = (unsigned )(position - (block << v->data_dev_block_bits)); res =dm_bufio_read (v->fec->bufio, v->fec->start + block, buf); -if (unlikely (IS_ERR (res))) { +if (IS_ERR (res)) { DMERR("%s: FEC %llu: parity read failed (block %llu): %ld", v->data_dev->name, (unsigned long long)rsb, (unsigned long long)(v->fec->start + block),
@@ -163,7 +163,7 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio,dm_bufio_release (buf); par =fec_read_parity (v, rsb, block_offset, &offset, &buf); -if (unlikely (IS_ERR (par))) +if (IS_ERR (par))return PTR_ERR (par); } }
@@ -250,7 +250,7 @@ static int fec_read_bufs(struct dm_verity *v, struct dm_verity_io *io, } bbuf =dm_bufio_read (bufio, block, &buf); -if (unlikely (IS_ERR (bbuf))) { +if (IS_ERR (bbuf)) { DMWARN_LIMIT("%s: FEC %llu: read failed (%llu): %ld", v->data_dev->name, (unsigned long long)rsb,
drivers/md/persistent-data/dm-block-manager.c +4 -4
@@ -462,7 +462,7 @@ int dm_bm_read_lock(struct dm_block_manager *bm, dm_block_t b,int r; p =dm_bufio_read (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p); aux =dm_bufio_get_aux_data (to_buffer (*result));
@@ -498,7 +498,7 @@ int dm_bm_write_lock(struct dm_block_manager *bm,return -EPERM ; p =dm_bufio_read (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p); aux =dm_bufio_get_aux_data (to_buffer (*result));
@@ -531,7 +531,7 @@ int dm_bm_read_try_lock(struct dm_block_manager *bm,int r; p =dm_bufio_get (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p);if (unlikely (!p))return -EWOULDBLOCK ;
@@ -567,7 +567,7 @@ int dm_bm_write_lock_zero(struct dm_block_manager *bm,return -EPERM ; p =dm_bufio_new (bm->bufio, b, (struct dm_buffer **) result); -if (unlikely (IS_ERR (p))) +if (IS_ERR (p))return PTR_ERR (p);memset (p,0 ,dm_bm_block_size (bm));
drivers/net/ethernet/amazon/ena/ena_com.c +2 -2
@@ -315,7 +315,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(struct ena_com_admin_queue cmd_size_in_bytes, comp, comp_size_in_bytes); -if (unlikely (IS_ERR (comp_ctx))) +if (IS_ERR (comp_ctx)) admin_queue->running_state = false;spin_unlock_irqrestore (&admin_queue->q_lock, flags);
@@ -1130,7 +1130,7 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue, comp_ctx =ena_com_submit_admin_cmd (admin_queue, cmd, cmd_size, comp, comp_size); -if (unlikely (IS_ERR (comp_ctx))) { +if (IS_ERR (comp_ctx)) {if (comp_ctx ==ERR_PTR (-ENODEV ))pr_debug ("Failed to submit command [%ld]\n" ,PTR_ERR (comp_ctx));
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
@@ -1491,7 +1491,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_napi *bnapi, u32 *raw_cons, (struct rx_tpa_end_cmp *)rxcmp, (struct rx_tpa_end_cmp_ext *)rxcmp1, event); -if (unlikely (IS_ERR (skb))) +if (IS_ERR (skb))return -EBUSY ; rc = -ENOMEM ;
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c +1 -1
@@ -256,7 +256,7 @@ struct sk_buff *mlx5e_ipsec_handle_tx_skb(struct net_device *netdev, goto drop; } mdata =mlx5e_ipsec_add_metadata (skb); -if (unlikely (IS_ERR (mdata))) { +if (IS_ERR (mdata)) {atomic64_inc (&priv->ipsec->sw_stats.ipsec_tx_drop_metadata); goto drop; }
drivers/net/ethernet/sun/ldmvsw.c +1 -1
@@ -307,7 +307,7 @@ static int vsw_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)/* Get (or create) the vnet associated with this port */ vp =vsw_get_vnet (hp, vdev->mp, &handle); -if (unlikely (IS_ERR (vp))) { +if (IS_ERR (vp)) { err =PTR_ERR (vp);pr_err ("Failed to get vnet for vsw-port\n" );mdesc_release (hp);
drivers/staging/lustre/lustre/obdclass/lu_object.c +1 -1
@@ -1626,7 +1626,7 @@ static int keys_fill(struct lu_context *ctx) } value = key->lct_init (ctx, key); -if (unlikely (IS_ERR (value))) { +if (IS_ERR (value)) {atomic_dec (&lu_key_initing_cnt);return PTR_ERR (value); }
fs/namei.c +1 -1
@@ -3458,7 +3458,7 @@ static int do_tmpfile(struct nameidata *nd, unsigned flags, goto out; child =vfs_tmpfile (path.dentry, op->mode, op->open_flag); error =PTR_ERR (child); -if (unlikely (IS_ERR (child))) +if (IS_ERR (child)) goto out2;dput (path.dentry); path.dentry = child;
fs/pstore/platform.c +1 -1
@@ -654,7 +654,7 @@ static int pstore_write_user_compat(struct pstore_record *record,return -EINVAL ; record->buf =memdup_user (buf, record->size); -if (unlikely (IS_ERR (record->buf))) { +if (IS_ERR (record->buf)) { ret =PTR_ERR (record->buf); goto out; }
net/core/datagram.c +1 -1
@@ -188,7 +188,7 @@ struct sk_buff *__skb_try_recv_from_queue(struct sock *sk, }if (!skb->len) { skb =skb_set_peeked (skb); -if (unlikely (IS_ERR (skb))) { +if (IS_ERR (skb)) { *err =PTR_ERR (skb);return NULL ; }
net/ipv6/addrconf.c +1 -1
@@ -3287,7 +3287,7 @@ static int fixup_permanent_addr(struct inet6_dev *idev,struct rt6_info *rt, *prev; rt =addrconf_dst_alloc (idev, &ifp->addr, false); -if (unlikely (IS_ERR (rt))) +if (IS_ERR (rt))return PTR_ERR (rt);/* ifp->rt can be accessed outside of rtnl */
net/kcm/kcmsock.c +1 -1
@@ -1650,7 +1650,7 @@ static int kcm_clone(struct socket *osock, struct kcm_clone *info, } newfile =sock_alloc_file (newsock,0 , osock->sk->sk_prot_creator->name); -if (unlikely (IS_ERR (newfile))) { +if (IS_ERR (newfile)) { err =PTR_ERR (newfile); goto out_sock_alloc_fail; }
Signature · 1 line
2.11.0